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

	<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>2007-04-29T20:37:57-04:00</updated>

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

		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-04-29T20:37:36-04:00</updated>

		<published>2007-04-29T20:37:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72368#p72368</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72368#p72368"/>
		<title type="html"><![CDATA[help with a simple Bot Query Kick Bug (SOLVED)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72368#p72368"><![CDATA[
ok thanks for the fast reply guys. will try the advice you guys gave. hope all things go smoothly this time. cheers!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8950">masheen</a> — Sun Apr 29, 2007 8:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-04-29T15:09:42-04:00</updated>

		<published>2007-04-29T15:09:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72357#p72357</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72357#p72357"/>
		<title type="html"><![CDATA[help with a simple Bot Query Kick Bug (SOLVED)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72357#p72357"><![CDATA[
Think of lists as a kind of psuedo-array, or a serialized array. Whitespace-characters are generally used to separate list entities, although any item may contain whitespace characters themselves - requiring some special encapsulation. You might wish to investigate the example below, and also observe the contents of the different variables. Also try some (inappropriate) list commands such as lindex and lrange on $mystring and observe how it might not produce the output you expected.<div class="codebox"><p>Code: </p><pre><code>set mystring "This is a string { of various } words and{ special characters"#convert the string to a properly structured list, treating space " " as a field-separator.set mylist [split $mystring " "]#Now retrieve a single item from the list, in this case "string"set myword [lindex $mylist 3]#Also retrieve a subset of the listset mysublist [lrange $mylist 5 6]#and convert it to a string (where each list-item will now be separated by a space " ")set mysubstring [join $mysublist " "]</code></pre></div>As for the string equal part; no, I'm not referring to the onchan tests, they look just fine. However, considder these two examples:<div class="codebox"><p>Code: </p><pre><code>#Bad way of doing it, may produce unexpected results in some rare conditions:if {$somestring == "someword"} {...#A better way of doing it:if {[string equal $somestring "someword"]} {...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Apr 29, 2007 3:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[YooHoo]]></name></author>
		<updated>2007-04-29T13:57:55-04:00</updated>

		<published>2007-04-29T13:57:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72353#p72353</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72353#p72353"/>
		<title type="html"><![CDATA[help with a simple Bot Query Kick Bug (SOLVED)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72353#p72353"><![CDATA[
you might wanna bind the message to some flags, ya think?  Kinda looks like anyone could use this code to kick anyone else...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2706">YooHoo</a> — Sun Apr 29, 2007 1:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-04-29T12:38:41-04:00</updated>

		<published>2007-04-29T12:38:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72352#p72352</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72352#p72352"/>
		<title type="html"><![CDATA[help with a simple Bot Query Kick Bug (SOLVED)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72352#p72352"><![CDATA[
<blockquote class="uncited"><div>Well, first off, don't use caps in topic... EVER!!!</div></blockquote>sori about this. its fixed<blockquote class="uncited"><div>Secondly, tcl is newline terminated, and "else" is not a separate command, but a parameter to "if"..</div></blockquote>got his one thanks.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <blockquote class="uncited"><div>Third, you really should not use list commands such as lindex and lrange on strings, either build proper list using the "list" command, or use "split" to convert a string to a list.<br>Also be aware that lindex will return the item stored at the specified offset in the list, while lrange will return a list with the subset selected. You'll most likely like to convert the output from lrange back to a string; "join" is the trick here.</div></blockquote>m a bit confused with this one? can u give me a line of code that explains this? i am better off understanding this with a code. <blockquote class="uncited"><div>Fourth, you'd really be better of using "string equal" for comparing strings, rather than using "blah == $blah". The latter can produce some unexpected results in rare conditions.</div></blockquote>um by string equals u mean sumthing like this? <strong class="text-strong">[onchan $nick $chan]</strong>. m a bit lost with tcl terms sori. again i understand better with a line of code.<br><br>lastly thanks very much for the help and for the additional help u may still give. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> pls bear with me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8950">masheen</a> — Sun Apr 29, 2007 12:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-04-29T10:42:56-04:00</updated>

		<published>2007-04-29T10:42:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72348#p72348</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72348#p72348"/>
		<title type="html"><![CDATA[help with a simple Bot Query Kick Bug (SOLVED)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72348#p72348"><![CDATA[
Well, first off, <strong class="text-strong"><span style="text-decoration:underline">don't use caps in topic... EVER!!!</span></strong><br><br>Secondly, tcl is newline terminated, and "else" is not a separate command, but a parameter to "if"..<div class="codebox"><p>Code: </p><pre><code>#This will work:if {...} {...} else {...}#However, this will notif {...} {...}else {...}</code></pre></div>Third, you really should not use list commands such as lindex and lrange on strings, either build proper list using the "list" command, or use "split" to convert a string to a list.<br>Also be aware that lindex will return the item stored at the specified offset in the list, while lrange will return a list with the subset selected. You'll most likely like to convert the output from lrange back to a string; "join" is the trick here.<br><br>Fourth, you'd really be better of using "string equal" for comparing strings, rather than using "blah == $blah". The latter can produce some unexpected results in rare conditions.<br><br>Also, if you use the code-tags rather than the quote-tags, the code is alittle easier to read...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Apr 29, 2007 10:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-04-29T20:37:57-04:00</updated>

		<published>2007-04-29T10:21:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72347#p72347</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72347#p72347"/>
		<title type="html"><![CDATA[help with a simple Bot Query Kick Bug (SOLVED)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72347#p72347"><![CDATA[
hi guys... m just starting out with TCL so pls bear if i am wasting ur time. can anybody point out why dis script simpy does nothing? its a script that i use to PM the bot to kick sum1 in a channel he is opped in<br><blockquote class="uncited"><div>bind msg - !k kick<br><br>proc kick {nick host hand arg} {<br>        set knick [lindex $arg 1]<br>set uchan [lindex $arg 0]<br>set kmsg [lrange $arg 2 end]<br>if {$knick == adzuBOT} { putserv "NOTICE $nick :no can do!" }<br>        if {[isop adzuBOT $uchan] &amp;&amp; [onchan $knick $uchan]}  {<br>                if {$nick == "masheen"} {<br>                        if {$kmsg == ""} {<br>putquick "KICK $chan $knick :Requested by $nick (OSX)<br>}<br>else {<br>putquick "KICK $chan $knick :$kmsg 14(7OSX14)"<br>}<br>                }<br>                return 0<br>        }<br>}</div></blockquote>on IRC i made a <strong class="text-strong">/msg &lt;botnick&gt; !b #chan nick</strong> on a bot using exactly the same logic as above and was working fine... can anyone point out the error why the bot simply just does nothing with this one? or maybe fix it for me pls? thanks in advance to anyone who would bother sharing a little time to help out people not as good with TCL programming as me. ^_^ (and sori if the script is not properly indented as i cant seem to get it right using quotes ehehe)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8950">masheen</a> — Sun Apr 29, 2007 10:21 am</p><hr />
]]></content>
	</entry>
	</feed>
