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

	<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>2009-06-20T05:49:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-06-20T05:49:25-04:00</updated>

		<published>2009-06-20T05:49:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89267#p89267</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89267#p89267"/>
		<title type="html"><![CDATA[Need help to get the join script working]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89267#p89267"><![CDATA[
thanks so fare <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Anyone know the error :<br><div class="codebox"><p>Code: </p><pre><code>##################### Mysql path #####################if {![info exists db_handle] } {set db_handle [mysqlconnect -host $sql(host) -user $sql(user) -password $sql(pass) -db $sql(db) -port $sql(port)]}############################################## Greeting MSG When User Join channel ##############################################proc bt.join.rank_title { chan nick rank_title} {if {[channel get $chan joinmsg]} {switch $rank_title {   ### The number is the number of the class on the site   ### "return 0" means no msg for that class   "1"   {putserv "PRIVMSG $chan :7Velkommen Til 4\:\:\:2 $username 4\:\:\:9 14 $rank_title"}      "default"   {set rank_title "Not Found" }  } }} #################### Join Proc ####################proc join:support {nick host hand chan} {global botnick db_handle  if {$nick != $botnick} {    #    if {[mysqlping $db_handle] != 1} {   #        putserv "notice $nick : The connection to the mysql server has been lost."   #          return 0   #    }              set sqlnick "SELECT user_id FROM phpbb_users WHERE username='[mysqlescape nick]'"       set resultusername [mysqlquery $db_handle $sqlnick]                    set nicki 0       while {[set record [mysqlnext $resultusername]] != ""} {         set user_id [lindex $record 0]         incr nicki       }                    if { $nick == 0 } { return 0 }                    if { $user_id == "" } { return 0 }                    set sql "SELECT rank_title FROM phpbb_ranks WHERE user_id='[mysqlescape $user_id]'"              set result [mysqlquery $db_handle $sql]                    set i 0       while {[set record [mysqlnext $result]] != ""} {                            set nick [lindex $record 0];         set rank_title [lindex $record 1];       }              set sql "SELECT rank_title FROM phpbb_ranks WHERE id='[mysqlescape $user_id]'"       set result [mysqlquery $db_handle $sql]                    set i 0       while {[set record [mysqlnext $result]] != ""} {                            set nick [lindex $record 0];         set rank_title [lindex $record 1];       }       mysqlendquery $result              bt.join.rank_title $chan $nick $rank_title    }  }</code></pre></div>I get this error now : Tcl error [join:support]: invalid command name "join:support"[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Sat Jun 20, 2009 5:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-06-19T20:48:16-04:00</updated>

		<published>2009-06-19T20:48:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89266#p89266</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89266#p89266"/>
		<title type="html"><![CDATA[Need help to get the join script working]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89266#p89266"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc join:Support-Forum.dk {nick host hand chan} {global botnick db_handle  if {$nick != $botnick} {    #    if {[mysqlping $db_handle] != 1} {   #        putserv "notice $nick : The connection to the mysql server has been lost."   #          return 0   #    }              set sqlnick "SELECT user_id FROM phpbb_users WHERE nick='[mysqlescape $username]'"       set resultusername [mysqlquery $db_handle $sqlusername] </code></pre></div>Here you can clearly see the problem. $nick is joining, yet you refer to this in your [mysqlescape] as $username. Change that to $nick. You also set sqlnick as your query. Yet when making the [mysqlquery] you refer to it as $sqlusername. Change it to $sqlnick. You need to keep your variables straight is the problem. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Jun 19, 2009 8:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-06-19T11:48:35-04:00</updated>

		<published>2009-06-19T11:48:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89256#p89256</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89256#p89256"/>
		<title type="html"><![CDATA[Need help to get the join script working]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89256#p89256"><![CDATA[
Hey all...<br><br><br>i have this join msg script. <br><br>An i would like it to announce when a user joins my channel. on quakenet, it announce the username and rank_title (phpbb2 forum) <br><br>1. the users are stored in phpbb_users -&gt; username ($user_id)<br>2. rank title is in phpbb_ranks -&gt; rank_title ($rank_id)<br><br><strong class="text-strong">[EDIT]</strong><br>I have tryed to set the table according, to the old owns in the script but it gives a error : Tcl error [join:Support-Forum.dk]: can't read "username": no such variable<br><strong class="text-strong">[/EDIT]</strong><br><br><div class="codebox"><p>Code: </p><pre><code>package require mysqltclsetudef flag joinmsg bind join - * join:Support-Forum.dkbind rejn - * join:Support-Forum.dk##################### Mysql path ###################### SQL infoset sql(host) "xxxxx"set sql(user) "xxxxx"set sql(pass) "xxxxx"set sql(db) "xxxxxxx"set sql(port) "3306"##################### Mysql path #####################if {![info exists db_handle] } {set db_handle [mysqlconnect -host $sql(host) -user $sql(user) -password $sql(pass) -db $sql(db) -port $sql(port)]}############################################## Greeting MSG When User Join channel ##############################################proc bt.join.rank_title { chan username rank_title} {if {[channel get $chan joinmsg]} {switch $rank_title {   ### The number is the number of the class on the site   ### "return 0" means no msg for that class   "1"   {putserv "PRIVMSG $chan :7Velkommen Til 4\:\:\:2 $username 4\:\:\:9 14 $rank_title"}      "default"   {set class "Not Found" }  } }} #################### Join Proc ####################proc join:Support-Forum.dk {nick host hand chan} {global botnick db_handle  if {$nick != $botnick} {    #    if {[mysqlping $db_handle] != 1} {   #        putserv "notice $nick : The connection to the mysql server has been lost."   #          return 0   #    }              set sqlnick "SELECT user_id FROM phpbb_users WHERE nick='[mysqlescape $username]'"       set resultusername [mysqlquery $db_handle $sqlusername]                    set nicki 0       while {[set record [mysqlnext $resultusername]] != ""} {         set user_id [lindex $record 0]         incr nicki       }                    if { $nicki == 0 } { return 0 }                    if { $user_id == "" } { return 0 }                    set sql "SELECT rank_title FROM phpbb_ranks WHERE id='[mysqlescape $user_id]'"              set result [mysqlquery $db_handle $sql]                    set i 0       while {[set record [mysqlnext $result]] != ""} {                            set username [lindex $record 0];         set rank_title [lindex $record 1];       }              set sql "SELECT rank_title FROM phpbb_ranks WHERE id='[mysqlescape $user_id]'"       set result [mysqlquery $db_handle $sql]                    set i 0       while {[set record [mysqlnext $result]] != ""} {                            set username [lindex $record 0];         set rank_title [lindex $record 1];       }       mysqlendquery $result              bt.join.rank_title $chan $nick $rank_title    }  }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Fri Jun 19, 2009 11:48 am</p><hr />
]]></content>
	</entry>
	</feed>
