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

	<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-30T11:40:38-04:00</updated>

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

		<entry>
		<author><name><![CDATA[daltonc]]></name></author>
		<updated>2005-04-30T11:40:38-04:00</updated>

		<published>2005-04-30T11:40:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48780#p48780</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48780#p48780"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48780#p48780"><![CDATA[
yup @<br><br>But now its retuning nothing and I Get no errors :*(<br><br><br>I can set greeting and trigger but I cant set.. anything after the 'else'<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6153">daltonc</a> — Sat Apr 30, 2005 11:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-04-30T11:24:14-04:00</updated>

		<published>2005-04-30T11:24:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48778#p48778</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48778#p48778"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48778#p48778"><![CDATA[
Looks like the bot doesn't recognize that you're oped, is your net-type setting correct in your bot's config file ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Apr 30, 2005 11:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daltonc]]></name></author>
		<updated>2005-04-30T10:51:26-04:00</updated>

		<published>2005-04-30T10:51:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48776#p48776</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48776#p48776"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48776#p48776"><![CDATA[
Alright sounds good, but the brackets are messed up:<br><div class="codebox"><p>Code: </p><pre><code>proc command:main:set {nick uhost hand chan arg} {if {[isop $nick $chan]} {    set result [mysql_query "SELECT chan_trigger FROM bot_channels WHERE chan_name='$chan'"]    foreach row $result {        foreach element $row {            set cmd_trigger $element        }    }    if {[string tolower [lindex [split $arg] 0]] == "${cmd_trigger}set" &amp;&amp; [string tolower [lindex $arg 1]] == "greeting" } {       set greeting "[lrange $arg 2 end]"       putnotc $nick "Set greeting to '^B$greeting^B'"     } elseif {[string tolower [lindex [split $arg] 0]] == "${cmd_trigger}set" &amp;&amp; [string tolower [lindex [split $arg] 1]] == "trigger"} {       set trigger "[lrange $arg 2 end]"       set save_trigger [mysql_query "UPDATE bot_channels SET chan_trigger='$trigger'"]       putnotc $nick "Set channel trigger to '^B$trigger^B'"     } else {        set command_input [string tolower [lindex $arg 1]]        set command_input_value  "[lrange $arg 2 end]"       set result [mysql_query "SELECT command_name FROM bot_commands WHERE command_chan='$chan' &amp;&amp; command_name='$command_input'"]       if {[info exist result]} {        foreach row $result {           foreach element $row {              set update_command [mysql_query "UPDATE bot_commands SET command_value='$command_input_value'"]              putnotc $nick "Updated $command_input to $command_input_value"           }         }       } else {         set insert_command [mysql_query "INSERT INTO bot_commands (command_chan, command_name, command_value) VALUES ('$chan', '$command_input', '$command_input_value'"]         putnotc $nick "Set $command_input to $command_input_value"       }     }     } else {     putnotc $nick "Error(1): You lack access to $chan"     putnotc $nick "Error(2): Unable to proccess command"  }}</code></pre></div>The reason I say bracket error is because I am getting this Error(1): You alck access to $chan.. and then the error(2), but I have ops in the channel. Any ideas?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6153">daltonc</a> — Sat Apr 30, 2005 10:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-04-30T08:15:57-04:00</updated>

		<published>2005-04-30T08:15:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48763#p48763</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48763#p48763"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48763#p48763"><![CDATA[
I think the error is from here<div class="codebox"><p>Code: </p><pre><code>if {[$result]} {</code></pre></div>This should return a boolean value (0 or 1). and as it seems in your proc, $result contains some different elements so it's probably not 0 or 1.<br>If you're trying to see if $result exists, then replace that with<div class="codebox"><p>Code: </p><pre><code>if {[info exists result]} {</code></pre></div>Although, I'm sure it'll always exist since the set command is right before it :p<br><br>Another simple but important thing to do is to replace<div class="codebox"><p>Code: </p><pre><code>[lrange $arg 2 end]</code></pre></div>with<div class="codebox"><p>Code: </p><pre><code>[join [lrange [split $arg] 2 end]]</code></pre></div>so you won't have problem with some particular characters.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Apr 30, 2005 8:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daltonc]]></name></author>
		<updated>2005-04-29T22:50:55-04:00</updated>

		<published>2005-04-29T22:50:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48722#p48722</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48722#p48722"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48722#p48722"><![CDATA[
I need some more help now. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br> <div class="codebox"><p>Code: </p><pre><code>proc command:main:set {nick uhost hand chan arg} {if {[isop $nick $chan]} {    set result [mysql_query "SELECT chan_trigger FROM bot_channels WHERE chan_name='$chan'"]    foreach row $result {        foreach element $row {            set cmd_trigger $element        }    }    if {[string tolower [lindex [split $arg] 0]] == "${cmd_trigger}set" &amp;&amp; [string tolower [lindex $arg 1]] == "greeting" } {       set greeting "[lrange $arg 2 end]"       putnotc $nick "Set greeting to '^B$greeting^B'"     } elseif {[string tolower [lindex [split $arg] 0]] == "${cmd_trigger}set" &amp;&amp; [string tolower [lindex [split $arg] 1]] == "trigger"} {       set trigger "[lrange $arg 2 end]"       set save_trigger [mysql_query "UPDATE bot_channels SET chan_trigger='$trigger'"]       putnotc $nick "Set channel trigger to '^B$trigger^B'"     } else {        set command_input [string tolower [lindex $arg 1]]        set command_input_value  "[lrange $arg 2 end]"       set result [mysql_query "SELECT command_name FROM bot_commands WHERE command_chan='$chan' &amp;&amp; command_name='$command_input'"]       if {[$result]} {        foreach row $result {           foreach element $row {              set update_command [mysql_query "UPDATE bot_commands SET command_value='$command_input_value'"]              putnotc $nick "Updated $command_input to $command_input_value"           }         }       } else {         set insert_command [mysql_query "INSERT INTO bot_commands (command_chan, command_name, command_value) VALUES ('$chan', '$command_input', '$command_input_value'"]         putnotc $nick "Set $command_input to $command_input_value"       }     }     } else {     putnotc $nick "Error(1): You lack access to $chan"     putnotc $nick "Error(2): Unable to proccess command"  }}</code></pre></div>I'm getting this error: <br>[22:48] Tcl error [command:main:set]: invalid command name ""<br><br>Its kinda confusing. I dont know what line its on.. I just know that thats the proc I am getting the error in. I image its somewhere 'set command_input' and 'set command_input_value' .... etc..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6153">daltonc</a> — Fri Apr 29, 2005 10:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-04-29T17:41:58-04:00</updated>

		<published>2005-04-29T17:41:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48710#p48710</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48710#p48710"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48710#p48710"><![CDATA[
try <strong class="text-strong">${cmd_trigger}set</strong> instead of <strong class="text-strong">$(cmd_trigger)set</strong>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Apr 29, 2005 5:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daltonc]]></name></author>
		<updated>2005-04-29T17:30:10-04:00</updated>

		<published>2005-04-29T17:30:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48709#p48709</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48709#p48709"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48709#p48709"><![CDATA[
Ok, another little thing (I think) <br><br>Here is my code: <br><div class="codebox"><p>Code: </p><pre><code>bind pub -|- * command:main:set### MAIN COMMAND FUNCTION ###proc command:main:set {nick uhost hand chan arg} {    set result [mysql_query "SELECT chan_trigger FROM bot_channels WHERE chan_name='$chan'"]    foreach row $result {        foreach element $row {            putnotc $nick "$element"            set cmd_trigger $element        }    }    putnotc $nick "$cmd_trigger"    if {[string tolower [lindex [split $arg] 0]] == $(cmd_trigger)set} {        putnotc $nick "You ran the 'set' command"    }}</code></pre></div>Now, I am trying to do this for 'custom' commands, and trying to obtain a trigger from the database which works correctly, I can obtain the trigger, but the bind isnt registring.. I dunno if * is wildcard but.. its not working. <br><br>In the database the chan_trigger is set to @ , and am typing @set and its not returning "You ran the 'set' command"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6153">daltonc</a> — Fri Apr 29, 2005 5:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-04-29T11:35:37-04:00</updated>

		<published>2005-04-29T11:35:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48696#p48696</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48696#p48696"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48696#p48696"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc command:main {nick uhost hand chan arg} {    set result [mysql_query "SELECT chan_trigger FROM bot_channels WHERE chan_name='$chan'"]    foreach row $result {        foreach element $row {            putnotc $nick "$element"            set cmd_trigger $element        }    }    if {[string tolower [lindex [split $arg] 0]] == $(cmd_trigger)set} {        putnotc $nick "You ran the 'set' command"    }} </code></pre></div>Try this.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Fri Apr 29, 2005 11:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daltonc]]></name></author>
		<updated>2005-04-29T10:55:07-04:00</updated>

		<published>2005-04-29T10:55:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48694#p48694</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48694#p48694"/>
		<title type="html"><![CDATA[Little problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48694#p48694"><![CDATA[
Ok, I am using this code to do my custom commands for my channel.. It doesnt seem to be working... This is what I have:<br><div class="codebox"><p>Code: </p><pre><code>proc command:main {nick uhost hand chan arg} {set result [mysql_query "SELECT chan_trigger FROM bot_channels WHERE chan_name='$chan'"]  foreach row $result {    foreach element $row {     putnotc $nick "$element"     set cmd_trigger $element    }  }if ([string tolower [lindex $arg 0]] == $(cmd_trigger}set} {   putnotc $nick "You ran the 'set' command" }}</code></pre></div>I am getting this error: <br><br>[10:49] extra characters after close-brace<br>    while executing<br>"proc command:main {nick uhost hand chan arg} {<br>set result [mysql_query "SELECT chan_trigger FROM bot_channels WHERE chan_name='$chan'"]<br>  foreach row..."<br>    (file "scripts/main.tcl" line 50)<br>    invoked from within<br>"source scripts/main.tcl"<br>    (file "bot_configs/eggdrop.conf" line 1343)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6153">daltonc</a> — Fri Apr 29, 2005 10:55 am</p><hr />
]]></content>
	</entry>
	</feed>
