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

	<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>2011-03-08T06:41:09-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-03-08T06:41:09-04:00</updated>

		<published>2011-03-08T06:41:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96393#p96393</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96393#p96393"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96393#p96393"><![CDATA[
caesar, <br><br>All i was saying it that there were things added that i didnt need and things i didnt understand and yes you both explained them. I guess i learn a different way as i make simple script and get them working then i grow on the scripts making them better when i learn more.<br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Tue Mar 08, 2011 6:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-08T01:36:17-04:00</updated>

		<published>2011-03-08T01:36:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96385#p96385</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96385#p96385"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96385#p96385"><![CDATA[
That's almost the same thing we said, meaning you need to store the channel in a global variable in the proc you trigger the whois then use it in the raw proc to do whatever you need. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Even with explaining each line of the code, you still didn't understood much?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Mar 08, 2011 1:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-03-07T19:08:22-04:00</updated>

		<published>2011-03-07T19:08:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96380#p96380</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96380#p96380"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96380#p96380"><![CDATA[
Anyways i finally found a way to declare the chan <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><div class="codebox"><p>Code: </p><pre><code>bind raw - 379 whois:stonerproc whois:stoner {from keyword text} {global whochan        putserv "PRIVMSG $whochan :My Modes are \00310[lrange $text 5 end]\003" }bind pub m ".whome" whomeproc whome {nick host handle chan arg} {global whochanputserv "whois Stoner"set whochan $chan}</code></pre></div>Probilly isent the best way but it works how i need it to <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Mon Mar 07, 2011 7:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-03-07T18:54:43-04:00</updated>

		<published>2011-03-07T18:54:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96379#p96379</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96379#p96379"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96379#p96379"><![CDATA[
speechles, caesar<br><br>Im sorry if it seems that i cant read or need help.<br><br>Im new to tcl scripting so i like to try to keep things simple.<br><br>Id rather have a command or whatever added to my first code so that i can learn from it and understand how it works.<br><br>Yes you guys make scripts that work how i need them but they are rather hard for me to understand them, so its a case of useing it but not learning to write it as i dont understand it.<br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Mon Mar 07, 2011 6:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-03-07T16:07:04-04:00</updated>

		<published>2011-03-07T16:07:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96377#p96377</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96377#p96377"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96377#p96377"><![CDATA[
<blockquote class="uncited"><div>Thanks but dont need<div class="codebox"><p>Code: </p><pre><code>  # does a channel to send whois info exist?  if {[info exists ::whereWhois]} {  </code></pre></div>as the chan does exist as i type .whome in that channel.</div></blockquote>You do need that, otherwise your procedure will swallow things it shouldn't. You are trapping raws. You will over-ride eggdrops own mechanism to detect things without that check.<br><blockquote class="uncited"><div>Dont need<div class="codebox"><p>Code: </p><pre><code>    # is it the bots nick?    if {[isbotnick $nick]} {</code></pre></div>The bot is called Stoner and the command is "whois Stoner"</div></blockquote>Your bot isn't always called that. It uses alternative nicknames. Also, anytime the bot runs whois on anyone your procedure will take-over. You sound like you don't want help. I should stop.<br><blockquote class="uncited"><div>basically i know that if i use <div class="codebox"><p>Code: </p><pre><code>{nick host handle chan arg}</code></pre></div> then i can use the $chan var as it is but with my code it uses <div class="codebox"><p>Code: </p><pre><code>{from keyword text}</code></pre></div></div></blockquote>You refuse to listen.  So help is beyond you. You don't know how to read.<br><blockquote class="uncited"><div>Thanks<br>Gemster</div></blockquote>No, it is us who thank you for being so obtuse..and wasting our efforts on you.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Mar 07, 2011 4:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-07T15:49:25-04:00</updated>

		<published>2011-03-07T15:49:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96376#p96376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96376#p96376"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96376#p96376"><![CDATA[
@speechles : was working on another script and guess I mixed stuff around. Thanks for pointing that out. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>@Gemster : I've already answered you to that question in the first post, guess you missed that out.<br><br>Anyway, raw proc expects 3 arguments: from keyword text. No matter how you name them and as long there are just 3, you would have the same information in each of them.<br><br>Like I've said before, you can't get a channel name out of the raw, or at least not like how you want. The whois command on the bot is triggered by a pub command, dcc chat or from where? Be more specific on what you want to do.<br><br>Oh, also moved this to <a href="http://forum.egghelp.org/viewforum.php?f=2" class="postlink">Scripting Help</a>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Mar 07, 2011 3:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-03-07T15:48:17-04:00</updated>

		<published>2011-03-07T15:48:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96375#p96375</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96375#p96375"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96375#p96375"><![CDATA[
Thanks but dont need<div class="codebox"><p>Code: </p><pre><code>  # does a channel to send whois info exist?  if {[info exists ::whereWhois]} {  </code></pre></div>as the chan does exist as i type .whome in that channel.<br><br>Dont need<div class="codebox"><p>Code: </p><pre><code>    # is it the bots nick?    if {[isbotnick $nick]} {</code></pre></div>The bot is called Stoner and the command is "whois Stoner"<br><br>basically i know that if i use <div class="codebox"><p>Code: </p><pre><code>{nick host handle chan arg}</code></pre></div> then i can use the $chan var as it is but with my code it uses <div class="codebox"><p>Code: </p><pre><code>{from keyword text}</code></pre></div> <br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Mon Mar 07, 2011 3:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-03-07T15:26:04-04:00</updated>

		<published>2011-03-07T15:26:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96374#p96374</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96374#p96374"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96374#p96374"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind raw - 379 whois:stonerproc whois:stoner {from keyword text} {  # does a channel to send whois info exist?  if {[info exists ::whereWhois]} {      #grab the user from $text    set nick [lindex [split $text] 0]       # is it the bots nick?    if {[isbotnick $nick]} {      # message the whois channel      putserv "PRIVMSG $::whereWhois :My Modes are \00310[join [lrange [split $text] 5 end]]\003"      # no longer need whois channel, discard it      unset ::whereWhois    }}bind pub m ".whome" whomeproc whome {nick host handle chan arg} {  # create a global variable, to hold the whois channel  set ::whereWhois $chan  # send the whois  putserv "whois $::botnick"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Mar 07, 2011 3:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-03-07T15:12:15-04:00</updated>

		<published>2011-03-07T15:12:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96372#p96372</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96372#p96372"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96372#p96372"><![CDATA[
Thanks caesar,<br><br>I think you may have missunderstud a little.<br><br>There is no user for it to whois, it whois itself. Basically this is for me to grab the bots modes when needed to check them.<br><div class="codebox"><p>Code: </p><pre><code>bind raw - 379 whois:stonerproc whois:stoner {from keyword text} {        putserv "PRIVMSG #opers :My Modes are \00310[lrange $text 5 end]\003" }bind pub m ".whome" whomeproc whome {nick host handle chan arg} {putserv "whois Stoner"}</code></pre></div>The above code i made works fine but will say im in channel #test or #help or #lobby ect and i type ".whome" it msg #opers not #test.<br><br>This is why i need to use $chan. and the bot is in all of the above mentioned channels.<br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Mon Mar 07, 2011 3:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-03-07T14:51:52-04:00</updated>

		<published>2011-03-07T14:51:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96371#p96371</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96371#p96371"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96371#p96371"><![CDATA[
Just a quick note:<br><blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code># grab the nicks that are stored in whoised array  set names [array names whoised]  # return if $nick doesn't exists in that $names list  if {![string equal -nocase $nick $names]} return</code></pre></div></div></blockquote>This can actually cause problems if the nicknames contain special characters. Things might not match since this uses the array names "list" within a "string" command.<br><div class="codebox"><p>Code: </p><pre><code>  # return if $nick doesn't exists in that $names list  if {[lsearch -exact -- $names $nick] == -1} return</code></pre></div>Using a "list" command on this "list" will avoid the problems that come with nicknames containing special characters...<br><br>Just trying to help avoid scenarios where people mingle string commands on lists and vice versa, as this is what creates exploits. This doesn't create an exploit in this example, but can cause things not to match when they should.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Mar 07, 2011 2:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-07T15:51:37-04:00</updated>

		<published>2011-03-07T08:22:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96356#p96356</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96356#p96356"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96356#p96356"><![CDATA[
You need to store that channel name in a variable (array) cos there's no way to get it just from a raw.<br><br>I'll give you an example on how this should be done.<div class="codebox"><p>Code: </p><pre><code>bind pub * .whois whois:pubbind raw - 379 whois:stonerproc whois:pub {nick uhost hand chan text} {  # we make sure we can access the variable globally  global whoised  # grab the person to whois from the user's input  set user [lindex [split $text] 0]  # store the name of the user and the channel in an array for later use  set whoised($user) $chan  # issue the whois command on the user  putserv "WHOIS $user"}proc whois:stoner {from keyword text} {  # globally call the whoised array  global whoised  # if the whoised array doesn't exists we return. better safe than sorry :)  if {![info exists whoised]} return  #grab the user from $text  set nick [lindex [split $text] 0]  # grab the nicks that are stored in whoised array  set names [array names whoised]  # return if $nick doesn't exists in that $names list  if {[lsearch -exact -- $names $nick] == -1} return  # $nick exists in the list, now let's grab the channel where the command to whois him has been issued  set channel $whoised($nick)  # we no longer need $nick in that array so we purge it  array unset whoised $nick  # do whatever you wish with $channel  putserv "PRIVMSG $channel :My Modes are \00310[lrange $text 5 end]\003"} </code></pre></div>I tried to explain all the lines of the code and hope you will understand them all. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> Anyway, don't be shy and leave a message if you haven't understood something.<br><br>Edit: fixed.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Mar 07, 2011 8:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-03-07T07:11:09-04:00</updated>

		<published>2011-03-07T07:11:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96354#p96354</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96354#p96354"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96354#p96354"><![CDATA[
<blockquote class="uncited"><div>The variables 'from keyword text' are correct. The $chan variable needs to declared before is used, thus why it complains about it can't be read.<br><br>Anyway, what you want to accomplish?</div></blockquote>I need to use $chan instead of #opers, so it will reply in any channel that me and the bot is in.<br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Mon Mar 07, 2011 7:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-07T02:19:34-04:00</updated>

		<published>2011-03-07T02:19:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96352#p96352</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96352#p96352"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96352#p96352"><![CDATA[
The variables 'from keyword text' are correct. The $chan variable needs to declared before is used, thus why it complains about it can't be read.<br><br>Anyway, what you want to accomplish?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Mar 07, 2011 2:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-03-06T20:36:05-04:00</updated>

		<published>2011-03-06T20:36:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96351#p96351</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96351#p96351"/>
		<title type="html"><![CDATA[can't read &quot;chan&quot;: no such variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96351#p96351"><![CDATA[
Hi i think i know the problem but not sure how to resolve it :/<br><div class="codebox"><p>Code: </p><pre><code>bind raw - 379 whois:stonerproc whois:stoner {from keyword text} {        putserv "PRIVMSG #opers :My Modes are \00310[lrange $text 5 end]\003" }</code></pre></div>This works fine but when i change channel #opers to $chan i get <em class="text-italics">can't read "chan": no such variable</em>.<br><br>I think it needs {nick host handle chan arg} but it also needs {from keyword text}.<br><br>So how do i overcome this so that i can use $chan<br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Sun Mar 06, 2011 8:36 pm</p><hr />
]]></content>
	</entry>
	</feed>
