<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/5527" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-09-10T01:55:04-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/5527</id>

		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-09-10T01:55:04-04:00</updated>

		<published>2003-09-10T01:55:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26862#p26862</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26862#p26862"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26862#p26862"><![CDATA[
<blockquote class="uncited"><div>Huh? What changes can be applied to this two then? And I'm not "spaming" around for posts <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"></div></blockquote><a href="http://forum.egghelp.org/viewtopic.php?p=26837#26837" class="postlink">http://forum.egghelp.org/viewtopic.php?p=26837#26837</a><br>For starters.. and Sir_Fz already took care of what you repeated.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Wed Sep 10, 2003 1:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-09-10T00:56:52-04:00</updated>

		<published>2003-09-10T00:56:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26857#p26857</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26857#p26857"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26857#p26857"><![CDATA[
Huh? What changes can be applied to this two then? And I'm not "spaming" around for posts <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Sep 10, 2003 12:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-09-09T15:56:13-04:00</updated>

		<published>2003-09-09T15:56:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26840#p26840</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26840#p26840"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26840#p26840"><![CDATA[
<blockquote class="uncited"><div>The<div class="codebox"><p>Code: </p><pre><code>set user [lindex [split $arg] 0]set reason [lrange [split $arg] 1 end]</code></pre></div>will do fine <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>Not without the mods mentioned in the last few posts...<br>quit trying to increase your post count, and read the posts :p<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Sep 09, 2003 3:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-09-09T15:54:51-04:00</updated>

		<published>2003-09-09T15:54:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26839#p26839</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26839#p26839"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26839#p26839"><![CDATA[
The<div class="codebox"><p>Code: </p><pre><code>set user [lindex [split $arg] 0]set reason [lrange [split $arg] 1 end]</code></pre></div>will do fine <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Sep 09, 2003 3:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-09T15:46:04-04:00</updated>

		<published>2003-09-09T15:46:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26838#p26838</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26838#p26838"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26838#p26838"><![CDATA[
lol, yes you're right.. the mistake of skipping the ":" is very common <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br>also if you see in the first code given "reason is set to [lindex $arg 1]" so its only 1 word too <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Sep 09, 2003 3:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-09-09T15:42:10-04:00</updated>

		<published>2003-09-09T15:42:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26837#p26837</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26837#p26837"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26837#p26837"><![CDATA[
Actually, upon furthur inspection of this case, with the given data,<br>the <strong class="text-strong">llength [split $arg]] == 2</strong> is the correct assertion, and I will explain why...<br><br>The code mentioned in this thread was:<div class="codebox"><p>Code: </p><pre><code>putserv "KILL $user $reason"</code></pre></div>Now, this will result in only using word 1 from $reason to issue the kill... to have a multi-word reason, this would need to be modified to:<br><div class="codebox"><p>Code: </p><pre><code>putserv "KILL $user :$reason"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Sep 09, 2003 3:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-09T15:41:57-04:00</updated>

		<published>2003-09-09T15:41:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26836#p26836</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26836#p26836"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26836#p26836"><![CDATA[
ok, I got how it works now, thanx <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Sep 09, 2003 3:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-09-09T15:37:40-04:00</updated>

		<published>2003-09-09T15:37:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26835#p26835</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26835#p26835"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26835#p26835"><![CDATA[
It dosen't matter what arguments you use in order to function propertly. The [lindex [split $arg] 0] and the [lrange [split $arg] 1 end] are correct. Also, it can be equal or bigger than 2 or just equal or smaller or whatever you want, it will still work. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Sep 09, 2003 3:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-09-09T15:37:28-04:00</updated>

		<published>2003-09-09T15:37:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26834#p26834</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26834#p26834"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26834#p26834"><![CDATA[
<blockquote class="uncited"><div>yes but i guess the reason would be more than one element<br>so the user would be [lindex [split $arg] 0] and the reason would be [lrange [split $arg] 1 end] so the llength wouldn't do it in this case ?</div></blockquote>To be honest, I wasn't really paying attention to the application, just the premise... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"> <br><br>But yes, llength will still apply... just needs to be modded slightly...<br><div class="codebox"><p>Code: </p><pre><code>if {[llength [split $arg]] &gt;= 2} { acceptable parameters code goes here }</code></pre></div>(Greater than or equal to 2 param's).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Sep 09, 2003 3:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-09T15:33:37-04:00</updated>

		<published>2003-09-09T15:33:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26833#p26833</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26833#p26833"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26833#p26833"><![CDATA[
yes but i guess the reason would be more than one element<br>so the user would be [lindex [split $arg] 0] and the reason would be [lrange [split $arg] 1 end] so the llength wouldn't do it in this case ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Sep 09, 2003 3:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-09-09T15:26:44-04:00</updated>

		<published>2003-09-09T15:26:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26831#p26831</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26831#p26831"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26831#p26831"><![CDATA[
<blockquote class="uncited"><div>so <strong class="text-strong">if {[llength [split $arg]] == 2} { ... }</strong> will check if the second word is empty then it will do whatever.... ?</div></blockquote>Not quite...<br>It will check if the length of the list is 2, implying that there are (no more than, and no less than) two non-empty elements within the [split $arg] list.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Sep 09, 2003 3:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-09-09T15:26:15-04:00</updated>

		<published>2003-09-09T15:26:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26830#p26830</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26830#p26830"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26830#p26830"><![CDATA[
The <em class="text-italics">llength</em> check will "test" if you have specified the two arguments that are needed, that's all, so yes, basicaly it would do the trick <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Sep 09, 2003 3:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-09T15:19:43-04:00</updated>

		<published>2003-09-09T15:19:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26829#p26829</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26829#p26829"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26829#p26829"><![CDATA[
so <strong class="text-strong">if {[llength [split $arg]] == 2} { ... }</strong> will check if the second word is empty then it will do whatever.... ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Sep 09, 2003 3:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-09-09T14:52:09-04:00</updated>

		<published>2003-09-09T14:52:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26828#p26828</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26828#p26828"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26828#p26828"><![CDATA[
<blockquote class="uncited"><div>the <em class="text-italics">string length</em> is to check if the string is empty, so [split $arg] would still be recommended... or not ?</div></blockquote>'string length' is a <strong class="text-strong">STRING</strong> operation (hence the 'string' word)<br>'llength' is a <strong class="text-strong">LIST</strong> operation (hence the 'l' letter in front)<br><br>Given: $arg is a <strong class="text-strong">string</strong><br><br>for 'llength' we need a <strong class="text-strong">list</strong> parameter... thus we <em class="text-italics">split</em> the string ($arg) converting it into a <strong class="text-strong">list</strong>.<br><br>for 'string length', $arg is already a <strong class="text-strong">string</strong> thus we do not need to convert it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Sep 09, 2003 2:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-09-09T14:49:12-04:00</updated>

		<published>2003-09-09T14:49:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26826#p26826</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26826#p26826"/>
		<title type="html"><![CDATA[i need basic script: !kill, !kline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26826#p26826"><![CDATA[
<blockquote class="uncited"><div>I think checking $arg as the first thing inside the proc would make the most sense. Then you would avoid all that work for nothing. No need to split an empty string just to find out it's empty <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>The best way to check if a variable is empty (imo) is <div class="codebox"><p>Code: </p><pre><code>if {[string length $arg]} {not empty} {empty}</code></pre></div></div></blockquote>That's nice and all... but as in this case, we are interested in checking for TWO (2) arguments within arg... thus, if only one is set instead of two, your check would give it a pass, when it should have failed...<br><br>For this situation caesars (+users fix) would be the best answer:<div class="codebox"><p>Code: </p><pre><code>if {[llength [split $arg]] == 2} { ... }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Sep 09, 2003 2:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
