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

	<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>2005-04-28T11:18:42-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-28T11:18:42-04:00</updated>

		<published>2005-04-28T11:18:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48662#p48662</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48662#p48662"/>
		<title type="html"><![CDATA[noobie help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48662#p48662"><![CDATA[
thats because you didnt make the variable global. I advise to use "set ::[.." to set and $::commands to read.<br>2 more suggestions:<br>use at the beginning<div class="codebox"><p>Code: </p><pre><code>        set arg [split $arg]        set var [string tolower [lindex $arg 0]]</code></pre></div>this saves you all the further tolower things, just use $var for the lindex thing and prevents the script from malefunctioning with "incorrect lists".<br><br>later for setting the var i would use that<div class="codebox"><p>Code: </p><pre><code>            set ::$var [join [lrange $arg 1 end]]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Apr 28, 2005 11:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-04-28T11:11:41-04:00</updated>

		<published>2005-04-28T11:11:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48661#p48661</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48661#p48661"/>
		<title type="html"><![CDATA[noobie help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48661#p48661"><![CDATA[
<blockquote class="uncited"><div>proc command:commands {nick uhost hand chan arg} {<br>putserv "NOTICE $nick :$commands"<br>}</div></blockquote>you forgot to global the variable. use<div class="codebox"><p>Code: </p><pre><code>proc command:commands {nick uhost hand chan arg} {    global commands    putserv "NOTICE $nick :$commands"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Thu Apr 28, 2005 11:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daltonc]]></name></author>
		<updated>2005-04-28T10:53:28-04:00</updated>

		<published>2005-04-28T10:53:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48660#p48660</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48660#p48660"/>
		<title type="html"><![CDATA[noobie help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48660#p48660"><![CDATA[
Great! That works, thanks dude! But for some strange reason its not picking up the variable in the next proc, here is what I have to read the commands variable<br><br>proc command:commands {nick uhost hand chan arg} {<br>putserv "NOTICE $nick :$commands"<br>}<br><br><br>In the channel I type @set commands @blah1 @blah2 , and then it goes putnotc $nick "I set your commands to $commands" therefore I know the variable is set yet when I type @commands to execute the proc commands:commands , it says its not set. <br><br>I am getting this error: <br>[10:52] Tcl error [command:commands]: can't read "commands": no such variable<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6153">daltonc</a> — Thu Apr 28, 2005 10:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-04-28T10:21:40-04:00</updated>

		<published>2005-04-28T10:21:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48656#p48656</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48656#p48656"/>
		<title type="html"><![CDATA[noobie help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48656#p48656"><![CDATA[
Try this.<br><div class="codebox"><p>Code: </p><pre><code>proc command:set {nick uhost hand chan arg} {    if {[isop $nick $chan]} {        if {[string tolower [lindex $arg 1]] == ""} {            putnotc $nick "Error(1): Nothing to set variable to."            return        }        if {[string tolower [lindex $arg 0]] == "commands"} {            set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"            putnotc $nick "Set commands to $commands"        } elseif {[string tolower [lindex $arg 0]] == "roster"} {            set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"            putnotc $nick "Set roster to $roster"        } elseif {[string tolower [lindex $arg 0]] == "website"} {            set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"            putnotc $nick "Set website to $website"        } elseif {[string tolower [lindex $arg 0]] == "sponsors"} {            set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"            putnotc $nick "Set sponsors to $sponsors"        } elseif {[string tolower [lindex $arg 0]] == "record"} {            set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"            putnotc $nick "Set record to $record"        } else {        putnotc $nick "Error(1): Unable to set [string tolower [lindex $arg 0]], try using: commands,roster,website,sponsors,record"        return        }    } else {    putnotc $nick "Error(1): You lack access to the 'set' command."    putnotc $nick "Error(2): Unable to 'set' [string tolower [lindex $arg 0]]."    return    }}</code></pre></div>I haven't tested this tho.<br><br>It also helps to properly format your code with the correct indentations to help see whats going on.<br><br>HTH.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Thu Apr 28, 2005 10:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daltonc]]></name></author>
		<updated>2005-04-28T08:48:56-04:00</updated>

		<published>2005-04-28T08:48:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48654#p48654</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48654#p48654"/>
		<title type="html"><![CDATA[noobie help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48654#p48654"><![CDATA[
Alright, thanks that seemed to get me through that error, here is my whole code: <br><div class="codebox"><p>Code: </p><pre><code>proc command:set {nick uhost hand chan arg} {if {[isop $nick $chan]} {if {[string tolower [lindex $arg 1]] == ""} {putnotc $nick "Error(1): Nothing to set variable to."} else {if {[string tolower [lindex $arg 0]] == "commands" || [string tolower [lindex $arg 0]] == "roster" || [string tolower [lindex $arg 0]] == "website" || [string tolower [lindex $arg 0]] == "sponsors" || [string tolower [lindex $arg 0]] == "record"} {  if {[string tolower [lindex $arg 0]] == "commands"} {  set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"  putnotc $nick "Set commands to $commands" } elseif {[string tolower [lindex $arg 0]] == "roster"} {  set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"  putnotc $nick "Set roster to $roster" } elseif {[string tolower [lindex $arg 0]] == "website"} {  set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"  putnotc $nick "Set website to $website" } elseif {[string tolower [lindex $arg 0]] == "sponsors"} {  set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"  putnotc $nick "Set sponsors to $sponsors" } elseif {[string tolower [lindex $arg 0]] == "record"} {  set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"  putnotc $nick "Set record to $record" }}} else {putnotc $nick "Error(1): Unable to set [string tolower [lindex $arg 0]], try using: commands,roster,website,sponsors,record"} else {putnotc $nick "Error(1): You lack access to the 'set' command."putnotc $nick "Error(2): Unable to 'set' [string tolower [lindex $arg 0]]."  } }}</code></pre></div>I am getting this error, I have done everything, moved brackets around and such. Anyone know: <br><br>Tcl error [command:set]: wrong # args: extra words after "else" clause in "if" command<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6153">daltonc</a> — Thu Apr 28, 2005 8:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-04-28T00:12:07-04:00</updated>

		<published>2005-04-28T00:12:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48639#p48639</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48639#p48639"/>
		<title type="html"><![CDATA[noobie help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48639#p48639"><![CDATA[
In comparing:<br>== when matches<br>!= when doesn't match<br><br>It should be:<br><div class="codebox"><p>Code: </p><pre><code>if {([string tolower [lindex $arg 0]] != "commands") || ([string tolower [lindex $arg 0]] != "website")} {</code></pre></div><br>Alternatively you can also use:<br><div class="codebox"><p>Code: </p><pre><code>if {![string equal -nocase "commands" [lindex $arg 0]] || ![string equal -nocase "website" [lindex $arg 0]]} {</code></pre></div>Or just convert the string into string tolower and removed the -nocase option, like this:<br><div class="codebox"><p>Code: </p><pre><code>if {![string equal "commands" [string tolower [lindex $arg 0]]] || ![string equal -nocase "website" [string tolower [lindex $arg 0]]]} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Thu Apr 28, 2005 12:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daltonc]]></name></author>
		<updated>2005-04-27T21:11:13-04:00</updated>

		<published>2005-04-27T21:11:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48636#p48636</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48636#p48636"/>
		<title type="html"><![CDATA[noobie help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48636#p48636"><![CDATA[
if {[string tolower [lindex $arg 0]] !== "commands" || [string tolower [lindex $arg 0]] !== "website"} { , is that correct? <br><br>I get this error: <br><br>Tcl error [command:set]: syntax error in expression "[string tolower [lindex $arg 0]] !== "commands" || [string t"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6153">daltonc</a> — Wed Apr 27, 2005 9:11 pm</p><hr />
]]></content>
	</entry>
	</feed>
