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

	<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>2006-09-08T10:12:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Ace-T]]></name></author>
		<updated>2006-09-08T10:12:47-04:00</updated>

		<published>2006-09-08T10:12:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66203#p66203</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66203#p66203"/>
		<title type="html"><![CDATA[IRC and MySQL help!!!!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66203#p66203"><![CDATA[
ok guys looking for some support here<br><br>i have a tcl code to update my mysqldb is a user joins or leaves irc...<br>i have mysqltcl in ok o i know what cant be the prob, its just it wont update the table in the sql.....<br><br>here is the code<br><div class="codebox"><p>Code: </p><pre><code>package require mysqltclset db_handle [mysqlconnect -host localhost -socket /var/lib/mysql/mysql.sock -user your db username -password your db pass -db you db name]# main stringsbind pub "-|-" !user ircjoinsetudef flag testingproc ircjoin { nick host handle channel text } {global db_handle quote_noflagsif {![channel get $channel testing]} {return 0}if [matchattr $handle $quote_noflags] { return 0 }if {($handle == "") || ($handle == "*")} {set handle $nick}set sql "UPDATE users SET onirc = 'yes' WHERE username ='$text'"putloglev d * "ircstats: executing $sql"set result [mysqlexec $db_handle $sql]if {$result != 1} {putlog "An error occurred with the sql :("} else {set id [mysqlinsertid $db_handle]puthelp "PRIVMSG $channel :User Online \002$nick\002 added"}}</code></pre></div>part 2 <br><div class="codebox"><p>Code: </p><pre><code># ---==( Channel Greet v1.1 )==-- by ArcAngeL -=o=- sysop@flexnet.org# Version 1.0:# - Website display and random info line for 2 chans## Version 1.1:# - added random part msg####### CONFIGURATION ####### Keep the channel names in lowercase !! if else it won't work !##### Set the MAIN channel configuration ####### Set the MAIN channel.set channel1 "#"## Set the channel website adress.set www1 "http://www.xxxxxxxxx.org"## Set date last update.set update1 "never cause we're lazy"### Set infolines for the MAIN channelset info1 {"You will recieve a point for every 15 minutes you spend in here."}## Do you want to display the website info on leave? (1-On/0-Off)set siteinfo1 "1"## The message diplayed when someone leaves.set partmsg1 {"Thanks for visiting, come again soon!""Leaving so soon ?""Hey, where do you think you are going ?"}##### Set the SECONDARY channel configuration ####### Set the MAIN channel.set channel2 "#"## Set the channel website adress.set www2 "http://www.xxxxxx.org"## Set date last update.set update2 "12 May 1999"### Set infolines for the SECONDARY channelset info2 {"Dit is het eindpunt, u ken niet vedâh.""Mocht u denkûh: Wat is dit ?, dit is nâh een i-er-zee kanaal""100% Haagse tjet, zeâh ongeschik voâh alle leifteidûh.""Keik nâh, ein bezoekâh!""Mogt het nâh allemaal te ruig wordûh, druk dan alt+ef-vieâh""Het einigûh wat mein compjoetâh zeg is: Feetal error"}## Do you want to display the website info on leave? (1-On/0-Off)set siteinfo2 "0"## The message diplayed when someone leaves.set partmsg2 {"Kreigûh we nâh ? loopûh we weg ?!""Bedank dat je geweis ben !!""Massol!"}##### END OF CONFIGURATION ######################################################################################################### #### CODE STARTS HERE DON'T EDIT ANYTHING BELOW !! OR THE SCRIPT MIGHT NOT FUNCTION RIGHT!!! #### ####################################################################################################bind join - "$channel1 %" msg_jmsg1bind part - "$channel1 %" msg_pmsg1proc msg_pmsg1 {nick uhost hand channel args} {global partmsg1 siteinfo1 www1 update1if {$siteinfo1 == "0"} {putserv "PRIVMSG # : [do_part1 $args]"return 0}if {$siteinfo1 == "1"} {putserv "PRIVMSG # : !useroff $nick"putserv "PRIVMSG # : [do_part1 $args]"return 0}}proc do_part1 {nick} {global partmsg1set partoutput1 [lindex $partmsg1 [rand [llength $partmsg1]]]return "$partoutput1"}proc msg_jmsg1 {nick uhost hand channel args} {global www1 update1putserv "PRIVMSG # :!user $nick"putserv "PRIVMSG # :(iNFO): [do_random1 $args]"return 0}proc do_random1 {nick} {global info1set output1 [lindex $info1 [rand [llength $info1]]]return "$output1"}bind join - "$channel2 %" msg_jmsg2bind part - "$channel2 %" msg_pmsg2proc msg_pmsg2 {nick uhost hand channel args} {global partmsg2 siteinfo2 www2 update2if {$siteinfo2 == "0"} {putserv "PRIVMSG $nick : [do_part2 $args]"return 0}if {$siteinfo2 == "1"} {putserv "PRIVMSG $nick : $www2 -updated!- $update2"putserv "PRIVMSG $nick : [do_part2 $args]"return 0}}proc do_part1 {nick} {global partmsg1set partoutput1 [lindex $partmsg1 [rand [llength $partmsg1]]]return "$partoutput1"}proc msg_jmsg2 {nick uhost hand channel args} {global www2 update2putserv "NOTICE $nick :(hTTP): $www2 -updated!- $update2"putserv "NOTICE $nick :(iNFO): [do_random2 $args]"}proc do_random2 {nick} {global info2set output2 [lindex $info2 [rand [llength $info2]]]return "$output2"}putlog "Channel Greet v1.1 By ArcAngeL.....Loaded!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8148">Ace-T</a> — Fri Sep 08, 2006 10:12 am</p><hr />
]]></content>
	</entry>
	</feed>
