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

	<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>2010-05-08T07:57:14-04:00</updated>

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

		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2010-05-08T07:57:14-04:00</updated>

		<published>2010-05-08T07:57:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93056#p93056</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93056#p93056"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93056#p93056"><![CDATA[
i will just add to this post,<br><br>the code between marks "#####Code by tomekk#####" is not the same like mine from:<br><a href="http://forum.egghelp.org/viewtopic.php?t=16547" class="postlink">http://forum.egghelp.org/viewtopic.php?t=16547</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Sat May 08, 2010 7:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2010-05-07T10:35:43-04:00</updated>

		<published>2010-05-07T10:35:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93055#p93055</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93055#p93055"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93055#p93055"><![CDATA[
I think you need to get yourself a syntax aware editor. The code is a bit of a mess.<br>Issues like the following can lead to 'false' errors, such as the one you have encountered.<br>I can't really understand how you managed to load the script, let alone get errors<br>Since Tomekk wouldn't write such rubbish, I can only assume you are editing somebody else's code and don't have a clue what you are doing<br><br>Use of undefined variable n :-<br><div class="codebox"><p>Code: </p><pre><code>putquick "privmsg $chan :$color1 $n $color2$color1 Info level $user_level $color2"</code></pre></div>Use of undefined variable db (bd is defined, did you mean that) :-<br><div class="codebox"><p>Code: </p><pre><code>set sd [::mysql::whois $db "SELECT username, level FROM $db_table" -list]</code></pre></div>Use of undefined variable db_table (bd_table is defined, did you mean that) :-<br><div class="codebox"><p>Code: </p><pre><code>set sd [::mysql::whois $db "SELECT username, level FROM $db_table" -list]</code></pre></div>Use of undefined variable login_ok :-<br><div class="codebox"><p>Code: </p><pre><code>if { $login_ok == 1 } {</code></pre></div>Missing close brace to conclude the following foreach statement :-<br><div class="codebox"><p>Code: </p><pre><code>foreach wl $sd {</code></pre></div>Missing close braces to conclude one or both of the following :-<br><div class="codebox"><p>Code: </p><pre><code>if { $login_ok == 0 } {if { $login_ok == 1 } {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Fri May 07, 2010 10:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dlpt]]></name></author>
		<updated>2010-05-07T10:20:19-04:00</updated>

		<published>2010-05-07T10:20:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93054#p93054</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93054#p93054"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93054#p93054"><![CDATA[
Now another error -.-'<br><div class="codebox"><p>Code: </p><pre><code>[15:20] missing close-brace    while executing"proc whois {nick uhost hand chan txt} {   global color1 color2 bd_user bd_pass bd_host bd_dbase bd_table      if { $login_ok == 1 } {      set m_h..."    (file "scripts/test.tcl" line 54)    invoked from within"source scripts/test.tcl"    (file "myegg.conf" line 1310)</code></pre></div>any idea ? <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=10868">dlpt</a> — Fri May 07, 2010 10:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2010-05-07T10:16:33-04:00</updated>

		<published>2010-05-07T10:16:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93053#p93053</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93053#p93053"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93053#p93053"><![CDATA[
Missing opening brace :-<br><div class="codebox"><p>Code: </p><pre><code>proc whois { nick uhost hand chan txt }</code></pre></div>Should be :-<br><div class="codebox"><p>Code: </p><pre><code>proc whois {nick uhost hand chan txt} {</code></pre></div>I have also removed the unnecessary spaces preceding and following the proc arguments.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Fri May 07, 2010 10:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dlpt]]></name></author>
		<updated>2010-05-07T10:16:38-04:00</updated>

		<published>2010-05-07T10:09:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93052#p93052</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93052#p93052"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93052#p93052"><![CDATA[
the error continues :s<br><div class="codebox"><p>Code: </p><pre><code>[15:06] Tcl error in file 'myegg.conf':[15:06] wrong # args: should be "proc name args body"    while executing"proc whois { nick uhost hand chan txt }"    (file "scripts/test.tcl" line 54)    invoked from within"source scripts/test.tcl"    (file "myegg.conf" line 1310)[15:06] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)</code></pre></div>I do not understand why  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><br><div class="codebox"><p>Code: </p><pre><code>set bd_user "fxp_egg"set bd_pass "password"set bd_host "localhost"set bd_dbase "fxp_test"set bd_table "users"bind msgm - "*" authbind pub - !whois whois#####Code by tomekk#####proc auth { nick uhost hand arg } {   global msql_user msql_pass msql_host msql_dbase msql_table invite_chan color1 color2 adminchannel   set all_prv_args [split $arg]   set priv_command [lindex $all_prv_args 0]   set priv_username [lindex $all_prv_args 1]   set priv_password [lindex $all_prv_args 2]   set login_ok 0   if {($priv_command == "auth") &amp;&amp; ($priv_username != "") &amp;&amp; ($priv_password != "")} {      set m_hand [::mysql::connect -host $msql_host -user $msql_user -password $msql_pass]      ::mysql::use $m_hand $msql_dbase      set users_passwords [::mysql::sel $m_hand "SELECT username, password FROM $msql_table" -list]      ::mysql::close $m_hand      foreach u_and_p $users_passwords {         if {$u_and_p != ""} {            set u_and_p_split [split $u_and_p]            set user_name [lindex $u_and_p_split 0]            set user_pass [lindex $u_and_p_split 1]            if {$priv_username == $user_name} {               if {$priv_password == $user_pass} {                  set login_ok 1      putquick "privmsg $nick :$color1 Login ok! $color2"               }            }         }      }      if {$login_ok == 0} {         putquick "PRIVMSG $nick :$color1 Login ERROR! $color2"      }   }}#####End code by Tomekk####proc whois { nick uhost hand chan txt }   global color1 color2 bd_user bd_pass bd_host bd_dbase bd_table   set bd [::mysql::connect -host $bd_host -user $bd_user -password $bd_pass]   if { $login_ok == 1 } {::mysql::use $db $msql_dbase    set sd [::mysql::whois $db "SELECT username, level FROM $db_table" -list]::mysql::close $db  foreach wl $sd {   if { $wl != "" } {      set wl_split [split $wl]      set user_name [lindex $wl_split 0]      set user_level [lindex $wl_split 2]   putquick "privmsg $chan :$color1 $n $color2$color1 Info level $user_level $color2"}}}   if { $login_ok == 0 } {   putquick "privmsg $chan :$color1 dont cry. $color2"}</code></pre></div>Hm, ok, I'll see if I learn.<br><br>dlpt,<br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10868">dlpt</a> — Fri May 07, 2010 10:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2010-05-07T09:57:10-04:00</updated>

		<published>2010-05-07T09:57:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93051#p93051</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93051#p93051"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93051#p93051"><![CDATA[
I assume you corrected the original error, since the whois proc has the required number of arguments for a PUB bind. I would avoid using 'arg' as an argument variable name because it is uncomfortably close to 'args' which has special meaning in Tcl. The generally accepted norm is to use 'text' or 'rest'.<br><br>Sorry, it's a very long time since I did any php. it would be like learning all over again. In any case this would not be the right forum for php script requests.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Fri May 07, 2010 9:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dlpt]]></name></author>
		<updated>2010-05-07T09:33:00-04:00</updated>

		<published>2010-05-07T09:33:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93050#p93050</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93050#p93050"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93050#p93050"><![CDATA[
sorry, error lol, the code are: <br><div class="codebox"><p>Code: </p><pre><code>set bd_user "fxp_egg"set bd_pass "password"set bd_host "localhost"set bd_dbase "fxp_test"set bd_table "users"bind msgm - "*" authbind pub - !whois whois#####Code by tomekkproc auth { nick uhost hand arg } {   global msql_user msql_pass msql_host msql_dbase msql_table invite_chan color1 color2 adminchannel   set all_prv_args [split $arg]   set priv_command [lindex $all_prv_args 0]   set priv_username [lindex $all_prv_args 1]   set priv_password [lindex $all_prv_args 2]   set login_ok 0   if {($priv_command == "auth") &amp;&amp; ($priv_username != "") &amp;&amp; ($priv_password != "")} {      set m_hand [::mysql::connect -host $msql_host -user $msql_user -password $msql_pass]      ::mysql::use $m_hand $msql_dbase      set users_passwords [::mysql::sel $m_hand "SELECT username, password FROM $msql_table" -list]      ::mysql::close $m_hand      foreach u_and_p $users_passwords {         if {$u_and_p != ""} {            set u_and_p_split [split $u_and_p]            set user_name [lindex $u_and_p_split 0]            set user_pass [lindex $u_and_p_split 1]            if {$priv_username == $user_name} {               if {$priv_password == $user_pass} {                  set login_ok 1putquick "privmsg $nick :$color1 Login ok! $color2"               }            }         }      }      if {$login_ok == 0} {         putquick "PRIVMSG $nick :$color1 Login ERROR! $color2"      }   }}#####End code by Tomekk####proc whois { nick uhost hand chan arg }   global color1 color2 bd_user bd_pass bd_host bd_dbase bd_table   set bd [::mysql::connect -host $bd_host -user $bd_user -password $bd_pass]   if { $login_ok == 1 } {   set sd [::mysql::whois $db "SELECT username, level FROM $db_table" -list]   foreach wl $sd {   if { $wl != "" } {      set wl_split [split $wl]      set user_name [lindex $wl_split 0]      set user_level [lindex $wl_split 2]   putquick "privmsg $chan :$color1 $n $color2$color1 Info level $user_level $color2"   }   if { $login_ok == 0 } {   putquick "privmsg $chan :$color1 dont cry. $color2"</code></pre></div>I record via the database users and meto the desired level<br><br>Table: <br><div class="codebox"><p>Code: </p><pre><code>create table users (        id int(4) auto_increment,        username varchar(12),        password varchar(12),        level varchar(12),        primary key(id)); </code></pre></div>btw, you could do me the code to record starting at php and give the automatic level one . A kind of small php script to log in<br><br>dlpt,<br>thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10868">dlpt</a> — Fri May 07, 2010 9:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2010-05-07T08:40:40-04:00</updated>

		<published>2010-05-07T08:40:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93049#p93049</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93049#p93049"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93049#p93049"><![CDATA[
Seems to be indicating that whatever calls/triggers the proc provides/requires a different number of arguments than are accounted for in the proc definition.<br><br>For one thing, your proc says this :-<br><div class="codebox"><p>Code: </p><pre><code>proc whois { nick uhost hand chan arg }</code></pre></div>But your error says this :-<br><div class="codebox"><p>Code: </p><pre><code>proc whois { nick uhost hand arg }</code></pre></div>We need to see what triggers it to be more help. Looks like some sort of Eggdrop Tcl BIND.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Fri May 07, 2010 8:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dlpt]]></name></author>
		<updated>2010-05-07T07:09:49-04:00</updated>

		<published>2010-05-07T07:09:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93048#p93048</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93048#p93048"/>
		<title type="html"><![CDATA[Error in my tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93048#p93048"><![CDATA[
need help in my tcl.<br><div class="codebox"><p>Code: </p><pre><code>proc whois { nick uhost hand chan arg }global color1 color2 bd_user bd_pass bd_host bd_dbase bd_tableset bd [::mysql::connect -host $bd_host -user $bd_user -password $bd_pass]if { $login_ok == 1 } {set sd [::mysql::whois $db "SELECT username, level FROM $db_table" -list]foreach wl $sd {if { $wl != "" } {set wl_split [split $wl]set user_name [lindex $wl_split 0]set user_level [lindex $wl_split 2]putquick "privmsg $chan :$color1 $n $color2$color1 Info level $user_level $color2"}if { $login_ok == 0 } {putquick "privmsg $chan :$color1 dont cry. $color2"</code></pre></div>I try ON eggdrop and:<br><div class="codebox"><p>Code: </p><pre><code>[12:02] wrong # args: should be "proc name args body"    while executing"proc whois { nick uhost hand arg }"    (file "scripts/test.tcl" line 12)</code></pre></div>Any idea ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10868">dlpt</a> — Fri May 07, 2010 7:09 am</p><hr />
]]></content>
	</entry>
	</feed>
