<?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/2725" />

	<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>2002-10-03T15:02:09-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2002-10-03T15:02:09-04:00</updated>

		<published>2002-10-03T15:02:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11671#p11671</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11671#p11671"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11671#p11671"><![CDATA[
lol  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Thu Oct 03, 2002 3:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-03T14:48:16-04:00</updated>

		<published>2002-10-03T14:48:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11668#p11668</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11668#p11668"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11668#p11668"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>if {($arg == "") || (![string is digit [lindex [split $arg] 1]]) || ([llength [split $arg]] == "3")} {</code></pre></div></div></blockquote>!lamer Papillon 10000 BLA BLA BLEH<br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Oct 03, 2002 2:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-03T14:46:41-04:00</updated>

		<published>2002-10-03T14:46:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11666#p11666</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11666#p11666"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11666#p11666"><![CDATA[
<blockquote class="uncited"><div>Okay I fixed the bug with the ban, and the script works fine now, but i still have some questions:<br><div class="codebox"><p>Code: </p><pre><code>if {([llength $arg]==0) || (![string is digit [lindex [split $arg] 1]]) || ([llength [lindex [split $arg] 2]])} {</code></pre></div>This line should check if: The user entered a parameter , the user entered a number, the user typed a third (wrong) argument.<br>A right input would be: !lamer NICK 10, but not !lamer NICK 10 BLA.<br>I hope you understand my thinking. Now, what should be fxied in this short source to make it work better?</div></blockquote>Doing [llength [lindex [split $arg] 2]] just to see if there is a third element, is a bit complicated. <br><br>Why not do it like:<br><div class="codebox"><p>Code: </p><pre><code>set arglist [split $arg]set listlen [llength $arglist]switch -- $listlen {   0 { # no nick, no bantime }   1 { # no bantime }   2 { # 2 parameters }   default { # more than 2 parameters }}</code></pre></div>Of course you can else make an if-elseif-elseif-else construction without "returns"<br><br>One interesting question is: if someone types !lamer  nick  10 (i.e. !lamer&lt;space&gt;&lt;space&gt;nick&lt;space&gt;10).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Oct 03, 2002 2:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2002-10-03T14:43:04-04:00</updated>

		<published>2002-10-03T14:43:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11665#p11665</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11665#p11665"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11665#p11665"><![CDATA[
THX <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=1729">ProXy</a> — Thu Oct 03, 2002 2:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2002-10-03T14:34:09-04:00</updated>

		<published>2002-10-03T14:34:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11664#p11664</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11664#p11664"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11664#p11664"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {($arg == "") || (![string is digit [lindex [split $arg] 1]]) || ([llength [split $arg]] == "3")} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Thu Oct 03, 2002 2:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2002-10-03T14:27:54-04:00</updated>

		<published>2002-10-03T14:27:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11662#p11662</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11662#p11662"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11662#p11662"><![CDATA[
Okay I fixed the bug with the ban, and the script works fine now, but i still have some questions:<br><div class="codebox"><p>Code: </p><pre><code>if {([llength $arg]==0) || (![string is digit [lindex [split $arg] 1]]) || ([llength [lindex [split $arg] 2]])} {</code></pre></div>This line should check if: The user entered a parameter , the user entered a number, the user typed a third (wrong) argument.<br>A right input would be: !lamer NICK 10, but not !lamer NICK 10 BLA.<br>I hope you understand my thinking. Now, what should be fxied in this short source to make it work better?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Thu Oct 03, 2002 2:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-03T13:08:15-04:00</updated>

		<published>2002-10-03T13:08:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11658#p11658</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11658#p11658"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11658#p11658"><![CDATA[
<blockquote class="uncited"><div>After testing for non-closed brackets, I was unable to locate any (allthough, my test suite is not the best thing int he world).<br><br>As such, there is no need to use any return statements.</div></blockquote>Of course you are right and subsequently my comments on the return statements can be ignored. I was guided too much by disliking the construction made  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Oct 03, 2002 1:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-03T12:47:12-04:00</updated>

		<published>2002-10-03T12:47:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11656#p11656</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11656#p11656"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11656#p11656"><![CDATA[
After testing for non-closed brackets, I was unable to locate any (allthough, my test suite is not the best thing int he world).<br><br>As such, there is no need to use any return statements.<br><div class="codebox"><p>Code: </p><pre><code>if {1==1} {  code1} elseif {2==2} {  code2} else {  code3}</code></pre></div>Neither the command code2, nor code3 will execute. This is due to the fact, the code is considered exactly like the following.<br><div class="codebox"><p>Code: </p><pre><code>if {1==1} {  code1} else {  if {2==2} {    code2  } else {    code3  }}</code></pre></div>If an IF statment, has allready made a match (thus executing the corisponding body), no more processing of the same IF is done.<br><br>In plain elglish, if-elseif-else work like this<br><div class="codebox"><p>Code: </p><pre><code>if {A is equal to B} {  then do this} if-nothing-aboved-matched-try-this {C is equal to D} {  then do this} otherwise-the-only-alternative-is-this {  do this}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Oct 03, 2002 12:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-03T12:35:19-04:00</updated>

		<published>2002-10-03T12:35:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11654#p11654</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11654#p11654"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11654#p11654"><![CDATA[
<blockquote class="uncited"><div>I just tested the script again: It is possible to use !lamer eS`rien, the bot bans the host (but the wrong host) and kicks the user. But it is NOT possible to kick or bann the user frz`bot...<br><br>The value of onchan frz`bot #HTP is 0, even when the user is in the channel!</div></blockquote>The fact that it bans the wrong host etc. is likely due to the fact that you don't have return values included. Review the above comments, and test the script again with putlogs added at critical points.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Oct 03, 2002 12:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-03T12:36:40-04:00</updated>

		<published>2002-10-03T12:34:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11653#p11653</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11653#p11653"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11653#p11653"><![CDATA[
First off, unrealted.<br><br>You have some un-needed code.<br><div class="codebox"><p>Code: </p><pre><code>if {[llength [lindex [split $arg] 1]]!=0} {</code></pre></div>split turns a string into a list.<br><br>lindex returns an item from the list, as a string.<br><br>llength measures how many items are in a list.<br><br>As such, you are using a string with the "llength" list command. When you should be using [string length].<br><br>Second, you have allready checked at the top of the script to see if the second argument is a number. thus, the default ban time, nor this code is of much use.<br><br>As for your problem, the only other thing this can be, is network related. What IRC network are you on, and what IRCD software does it use?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Oct 03, 2002 12:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-03T12:37:54-04:00</updated>

		<published>2002-10-03T12:31:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11652#p11652</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11652#p11652"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11652#p11652"><![CDATA[
That is some interesting code  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_evil.gif" width="15" height="15" alt=":evil:" title="Evil or Very Mad"> <br><br>Just some general suggestions:<br><br>1. The if-the-else-elseif constructions are too complicated. A simple approach:<br><div class="codebox"><p>Code: </p><pre><code>if {conditional statement } {   do something   return 1}if {conditional statement } {   do something   return 1}etc. etc.</code></pre></div>2. In most of the if-then statements you must include return statements. The return statements will stop further processing of the procedure.<br><br>3. A lot of times statements like "[lindex [split $arg] 0]" are used. For easier reading it is better to reuse variables. Example:<br><blockquote class="uncited"><div>set arglist [split $arg]<br>set listlen [llength $arglist]<br>set lamer [lindex $arglist 0]<br>set bantime [lindex $arglist 1]<br><br>reuse these variable in the code.</div></blockquote>4. What is the idea of ([llength [lindex [split $arg] 2]])?<br><br>5. Instead of sending out a +b, a kick and an unban, it can be easier to simply set a "newchanban" (tcl-commands.doc) and with the correct settings let the bot enforce this ban.<br><br>6. Why use a timed kick which send a kick only 2 seconds after the command is issued?<br><br>7. running a test with a nick with ``` in it, just worked fine.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Oct 03, 2002 12:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2002-10-03T11:39:46-04:00</updated>

		<published>2002-10-03T11:39:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11650#p11650</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11650#p11650"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11650#p11650"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>#### Flag for global users ####set lamerglobalflag "*"#### Flag for local users #####set lamerlocalflag "*"####### Public command ########set lamercommand "!lamer"## default ban-time in mins ###set lamerdefaulttime "10"#### END OF CONFIGURATION #####set lamerusage "Usage: $lamercommand &lt;nick&gt; \[time\]"bind pub $lamerglobalflag|$lamerlocalflag $lamercommand pub:lamerproc pub:lamer { nick uhost handle channel arg } {global botnick lamerdefaulttime lamerusageif {([llength $arg]==0) || (![string is digit [lindex [split $arg] 1]]) || ([llength [lindex [split $arg] 2]])} {putserv "PRIVMSG $channel :$lamerusage"} elseif {[onchan [lindex [split $arg] 0] $channel]!=1} {putserv "PRIVMSG $channel :Error: \"[lindex [split $arg] 0]\" ist nicht in diesem Channel! $lamerusage"} elseif {![botisop $channel]} {putserv "PRIVMSG $channel :$nick: Ja, du Scherzkeks, dann gib mir OP!"} elseif {[string tolower [lindex [split $arg] 0]]==[string tolower $botnick]} {putserv "PRIVMSG $channel :$nick: So blöd bin ich nun wirklich nicht..."} else {if {[llength [lindex [split $arg] 1]]!=0} {set lamerbantime [lindex [split $arg] 1]} else {set lamerbantime $lamerdefaulttime}set lamerhost [getchanhost [lindex [split $arg] 0] $channel]putserv "MODE $channel +b [lindex [split $arg] 0]!$lamerhost"if {$lamerbantime==1} {set lamermins "minute"} else {set lamermins "minutes"}utimer 2 [list putkick $channel [lindex [split $arg] 0] "banned for $lamerbantime $lamermins"] timer $lamerbantime [list putserv "MODE $channel -b [lindex [split $arg] 0]!$lamerhost"]}}</code></pre></div>Perhaps you could also check why he sometimes bans a wrong host <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I just tested the script again: It is possible to use !lamer eS`rien, the bot bans the host (but the wrong host) and kicks the user. But it is NOT possible to kick or bann the user frz`bot...<br><br>The value of onchan frz`bot #HTP is 0, even when the user is in the channel!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Thu Oct 03, 2002 11:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-03T11:34:23-04:00</updated>

		<published>2002-10-03T11:34:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11649#p11649</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11649#p11649"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11649#p11649"><![CDATA[
<blockquote class="uncited"><div>Oh but it is still not possible to Kick User that have ` in their nick. Any ideas?</div></blockquote>Lot of ideas <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> But need to see the full script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Oct 03, 2002 11:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2002-10-03T11:35:57-04:00</updated>

		<published>2002-10-03T11:31:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11648#p11648</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11648#p11648"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11648#p11648"><![CDATA[
Oh but it is still not possible to Kick User that have ` in their nick. Any ideas?<br><br>I also found another bug. In some cases the eggdrop cannot ban the user because he bans the wrong hostmask!<br><div class="codebox"><p>Code: </p><pre><code>set lamerhost [getchanhost [lindex [split $arg] 0] $channel]putserv "MODE $channel +b [lindex [split $arg] 0]!$lamerhost"</code></pre></div>Isn`t this source right?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Thu Oct 03, 2002 11:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2002-10-03T07:20:51-04:00</updated>

		<published>2002-10-03T07:20:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11642#p11642</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11642#p11642"/>
		<title type="html"><![CDATA[Problems with Brackets &amp; Pipes...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11642#p11642"><![CDATA[
*lol* Thx a lot - I ever thought about this way - all problems fixed now <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=1729">ProXy</a> — Thu Oct 03, 2002 7:20 am</p><hr />
]]></content>
	</entry>
	</feed>
