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

	<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>2004-01-29T13:04:33-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2004-01-29T13:04:33-04:00</updated>

		<published>2004-01-29T13:04:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33070#p33070</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33070#p33070"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33070#p33070"><![CDATA[
Your welcome. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Jan 29, 2004 1:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2004-01-29T12:50:51-04:00</updated>

		<published>2004-01-29T12:50:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33069#p33069</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33069#p33069"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33069#p33069"><![CDATA[
alright, i feel like a retard now.<br><br>Thanks a lot man, it solved the problem. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Thu Jan 29, 2004 12:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-01-28T12:31:38-04:00</updated>

		<published>2004-01-28T12:31:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33024#p33024</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33024#p33024"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33024#p33024"><![CDATA[
set time [lindex $text 1]? <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=2878">user</a> — Wed Jan 28, 2004 12:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2004-01-28T12:23:18-04:00</updated>

		<published>2004-01-28T12:23:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33022#p33022</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33022#p33022"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33022#p33022"><![CDATA[
I have looked over it time and time again, and i just dont see it. I already fixed those errors.<br><div class="codebox"><p>Code: </p><pre><code>proc academy:ban {nick host handle chan text} {   global botnick guardmethod botname  if {(![authed $handle]) || ![string equal -nocase $chan "#jedi-academy"]} { return 0 }   set userlevel [level $handle]  set nickhost [lindex [split $text] 0]  set time [lindex $text 1]  set reason [join [lrange [split $text] 2 end]]  if {$userlevel == "Knight" || $nickhost == ""} {return 0}  if {[string tolower $time] == "perm"} { set time 0 }   if {[onchan $nickhost $chan]} {   if {[string match "*.users.quakenet.org" [getchanhost $nickhost $chan]]} {  set banmask "*!*@[join [lindex [split [getchanhost $nickhost $chan] @] 1]]"   } else {      set banmask "*!*[string trimleft [maskhost [getchanhost $nickhost $chan]] *!]" }  }  if {$reason == ""} {  set reason "Banned via JAbot by $nick. No reason specified."  }if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} {  return 0}   if {[botisop $chan]} {  if {[onchan $nickhost $chan]} {         if {![string match -nocase $nickhost $botname] || ![isbotnick $nickhost]} {         if {$time == "0"} {           newchanban $chan $banmask [nick2hand $nick] "$reason (permanent)" $time        } else {           newchanban $chan $banmask [nick2hand $nick] "$reason ($time minutes)" $time            }            webbanlist_createhtml        } else {      putserv "$guardmethod $nick : $nick whats wrong with you?"          }} else {    if {![string equal -nocase [maskhost [getchanhost $botnick]] $nickhost] &amp;&amp; ![string equal -nocase $botnick $nickhost]} { newchanban $chan $nickhost $handle "$reason" $time      putserv "$guardmethod $nick : $nick, \002$nickhost\002 has been added to the $chan banlist, and will be banned when he enters."    webbanlist_createhtml        } else {      putserv "$guardmethod $nick : $nick, quit messing around."        }                }  } else {    putserv "$guardmethod $nick  : $botnick is not opped on $chan"    } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Wed Jan 28, 2004 12:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2004-01-23T08:49:55-04:00</updated>

		<published>2004-01-23T08:49:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32808#p32808</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32808#p32808"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32808#p32808"><![CDATA[
Haven't you learned anything by now? In if {$foo == "foo"} { eyther do an string tolower/ toupper to the $foo or use the "string equal -nocase" to do that for you cos FOO (Foo, fOo, etc.) is not equal with "foo"..<div class="codebox"><p>Code: </p><pre><code>if {![string equal -nocase [maskhost [getchanhost $botnick]] $nickhost] .. etc.</code></pre></div>no way, better use the $botname to get it's nick!ident@host that that and cmpare it with "string match -nocase".<div class="codebox"><p>Code: </p><pre><code>if {[string match -nocase $nickhost $botname]} { # etc. }</code></pre></div>Your code is so mixed up.. confused me a a lil bit..<div class="codebox"><p>Code: </p><pre><code>if {![string equal -nocase [maskhost [getchanhost $botnick]] [maskhost $nickhost]] &amp;&amp; ![string equal -nocase $botnick $nickhost]} { </code></pre></div>no, better use "isbotnick" instead of "![string equal -nocase $botnick $nickhost]" if you are comparing the two nicks or something similar.<div class="codebox"><p>Code: </p><pre><code>if {[nick2hand $nickhost] != "*"} {   if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} {     return 0   } } </code></pre></div>Either store the [nick2hand $nickhost] in to an variable and don't call it twice or go directly to:<div class="codebox"><p>Code: </p><pre><code>if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} {   return 0 }</code></pre></div>cos as far as I see there is no need of the first check.<div class="codebox"><p>Code: </p><pre><code>if {$time == "perm"} { set time "0" } </code></pre></div>should be:<div class="codebox"><p>Code: </p><pre><code>if {[string tolower $time] == "perm"} { set time 0 }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Jan 23, 2004 8:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2004-01-23T08:06:08-04:00</updated>

		<published>2004-01-23T08:06:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32807#p32807</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32807#p32807"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32807#p32807"><![CDATA[
alright, thanks a lot <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>It's working now, but now im having the same problem with my ban command... I just don't see it.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><div class="codebox"><p>Code: </p><pre><code>proc academy:ban {nick host handle chan text} {   global botnick guardmethod   if {(![authed $handle]) || ![string equal -nocase $chan "#jedi-academy"]} { return 0 }   set userlevel [level $handle]  set nickhost [lindex [split $text] 0]  set time [lindex $text 1]  set reason [join [lrange [split $text] 2 end]]  if {$userlevel == "Knight" || $nickhost == ""} {return 0}  if {$time == "perm"} { set time "0" }  if {[onchan $nickhost $chan]} {   if {[string match "*.users.quakenet.org" [getchanhost $nickhost $chan]]} {  set banmask "*!*@[lindex [split [getchanhost $nickhost $chan] @] 1]"   } else {      set banmask "*!*[string trimleft [maskhost [getchanhost $nickhost $chan]] *!]" }  }  if {$reason == ""} {  set reason "Banned via JAbot by $nick. No reason specified."  }  if {[nick2hand $nickhost] != "*"} {  if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} {   return 0 }   }  if {[botisop $chan]} {  if {[onchan $nickhost $chan]} {    if {![string equal -nocase [maskhost [getchanhost $botnick]] [maskhost $nickhost]] &amp;&amp; ![string equal -nocase $botnick $nickhost]} {         if {$time == "0"} {           newchanban $chan $banmask [nick2hand $nick] "$reason (permanent)" $time        } else {           newchanban $chan $banmask [nick2hand $nick] "$reason ($time minutes)" $time            }            webbanlist_createhtml        } else {      putserv "$guardmethod $nick : $nick whats wrong with you?"          }} else {    if {![string equal -nocase [maskhost [getchanhost $botnick]] $nickhost] &amp;&amp; ![string equal -nocase $botnick $nickhost]} { newchanban $chan $nickhost $handle "$reason" $time      putserv "$guardmethod $nick : $nick, \002$nickhost\002 has been added to the $chan banlist, and will be banned when he enters."    webbanlist_createhtml        } else {      putserv "$guardmethod $nick : $nick, quit messing around."        }                }  } else {    putserv "$guardmethod $nick  : $botnick is not opped on $chan"    } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Fri Jan 23, 2004 8:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-01-22T22:34:35-04:00</updated>

		<published>2004-01-22T22:34:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32801#p32801</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32801#p32801"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32801#p32801"><![CDATA[
Just to clear it up, as it may pose to some a bit of confusion...<br><br>We <em class="text-italics">join</em> the "lrange" result (the reason) because lrange returns a <strong class="text-strong">list</strong> of elements, and the list needs to be converted back to <strong class="text-strong">string</strong>...<br><br>You do NOT <em class="text-italics">join</em> the result of "lindex" (in this case, anyways), as it returns a single element, which happens to already be a string.<br><br>Usually, you will only need to use <em class="text-italics">join</em> on a lindex operation when the list you are working with is a list of lists (that is, sub-lists contained within a list).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Thu Jan 22, 2004 10:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-01-22T21:07:37-04:00</updated>

		<published>2004-01-22T21:07:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32796#p32796</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32796#p32796"/>
		<title type="html"><![CDATA[Re: Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32796#p32796"><![CDATA[
<blockquote class="uncited"><div><strong class="text-strong">Don't</strong> 'join' the <strong class="text-strong">string</strong> returned by 'lindex' and everything should be fine <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Jan 22, 2004 9:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2004-01-22T20:30:41-04:00</updated>

		<published>2004-01-22T20:30:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32795#p32795</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32795#p32795"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32795#p32795"><![CDATA[
the nickname is only stored in nickhost, and there are no processes interfering with it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Thu Jan 22, 2004 8:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-01-22T19:39:02-04:00</updated>

		<published>2004-01-22T19:39:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32794#p32794</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32794#p32794"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32794#p32794"><![CDATA[
read my first post<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Jan 22, 2004 7:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2004-01-22T18:57:16-04:00</updated>

		<published>2004-01-22T18:57:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32793#p32793</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32793#p32793"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32793#p32793"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc academy:kick {nick host handle chan text} {   global botnick guardmethod   if {(![authed $handle]) || ![string equal -nocase $chan "#jedi-academy"]} { return 0 }  set userlevel [level $handle]  set reason [join [lrange [split $text] 1 end]]  if {$reason == ""} {    set reason "requested by $nick"  }    set nickhost [join [lindex [split $text] 0]]  if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} { return 0 } if {[string equal -nocase $nickhost "me"]} {     set nickhost $nick    set reason "$nick is a poopoohead!"  }      if {[botisop $chan]} {  if {![string equal -nocase $botnick $nickhost]} {       putkick $chan $nickhost $reason    } else {        putserv "NOTICE $nick :Stop messing around..."    }  } else {      putserv "NOTICE $nick :I'm not opped in $chan!"  }}proc lastban_check {nick uhost hand chan mode victim } { global lastbanned  if {[lindex $mode 0] == "+b"} {   set lastbanned($chan) $victim   }  }</code></pre></div>changed the code. Still the same error.<br><br>"[16:57] Tcl error [academy:kick]: list element in braces followed by "testing" instead of space"<br><br>The nick i tried to kick was {}testing<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Thu Jan 22, 2004 6:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2004-01-22T15:55:53-04:00</updated>

		<published>2004-01-22T15:55:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32788#p32788</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32788#p32788"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32788#p32788"><![CDATA[
After a lil discution on irc with strikelight and Souperman and thinked a lil bit at that thing I've realised that strikelight was right, so the correct and best solution is [join [lrange [split $text] 1 end]]. Thanks for clearing that out strikelight, ow you one <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>/me dose 20 hail mary's to be forgiven <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> — Thu Jan 22, 2004 3:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-01-22T15:25:17-04:00</updated>

		<published>2004-01-22T15:25:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32787#p32787</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32787#p32787"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32787#p32787"><![CDATA[
<blockquote class="uncited"><div>Umm.. actualy no, it's an string.. umm. To be honest I haven't understood completly your response..</div></blockquote>  No caesar... lrange returns a list....<br><br>from the TCL Manpages for lrange:<blockquote class="uncited"><div>This command will return a new <strong class="text-strong">list</strong> consisting of elements first through last, inclusive. </div></blockquote>Hence, the need for "join".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Thu Jan 22, 2004 3:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2004-01-22T15:18:20-04:00</updated>

		<published>2004-01-22T15:18:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32786#p32786</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32786#p32786"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32786#p32786"><![CDATA[
Umm.. actualy no, it's an string.. umm. To be honest I haven't understood completly your response..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Jan 22, 2004 3:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-01-22T14:30:07-04:00</updated>

		<published>2004-01-22T14:30:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32784#p32784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32784#p32784"/>
		<title type="html"><![CDATA[Kicking nicknames with brackets in them]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32784#p32784"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>lrange returns a (sub)list, and from my understanding, $reason is supposed to be a string... as such you need to apply the join tcl command to the result to make it into a proper string.</div></blockquote>Yup, you also have to [split] it before using [lrange] on it, like caesar says.</div></blockquote> Right, however my response was in fact a reply to caesar's post.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Thu Jan 22, 2004 2:30 pm</p><hr />
]]></content>
	</entry>
	</feed>
