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

	<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>2007-04-13T11:46:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[traxwriter]]></name></author>
		<updated>2007-04-13T11:46:03-04:00</updated>

		<published>2007-04-13T11:46:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72048#p72048</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72048#p72048"/>
		<title type="html"><![CDATA[Voice user if in MYSQL db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72048#p72048"><![CDATA[
OK that didn't work, but you prompted me to sort it myself:<br><br>Replace:<br>pushmode $chan +v $nick <br>With:<br>putserv "MODE $channel +v $nick" <br><br>And Replace:<br>pushmode $chan -v $newnick <br>With:<br>putserv "MODE $channel -v $newnick"<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8835">traxwriter</a> — Fri Apr 13, 2007 11:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[traxwriter]]></name></author>
		<updated>2007-04-13T05:15:15-04:00</updated>

		<published>2007-04-13T05:15:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72039#p72039</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72039#p72039"/>
		<title type="html"><![CDATA[Voice user if in MYSQL db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72039#p72039"><![CDATA[
Thats great thanks DayCuts<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8835">traxwriter</a> — Fri Apr 13, 2007 5:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DayCuts]]></name></author>
		<updated>2007-04-07T02:55:14-04:00</updated>

		<published>2007-04-07T02:55:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71870#p71870</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71870#p71870"/>
		<title type="html"><![CDATA[Re: Voice user if in MYSQL db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71870#p71870"><![CDATA[
All you really need to do is use pushmode after the user online messages.<br><br>Altered script (not tested but should be fine).<br><div class="codebox"><p>Code: </p><pre><code>load /usr/lib/mysqltcl-2.30/libmysqltcl2.30.sopackage require mysqltclset db_handle [mysqlconnect -host localhost -socket /var/run/mysqld/mysqld.sock -user user -password pass -db database]bind join - "#channel *" join_mainbind part - "#channel *" part_mainbind sign - "#channel *" sign_mainbind nick - "#channel *" nick_mainproc sign_main {nick uhost hand channel reason} {global db_handle botnick  if {$nick==$botnick} {return 0}  set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"  putloglev d * "ircstats: executing $sql"  set result [mysqlexec $db_handle $sql]  if {$result != 1} {    putlog "SQL - Error"  } else {     set id [mysqlinsertid $db_handle]     puthelp "PRIVMSG $channel :5 User Offline: \002$nick\002 - IRC bonus disabled"  }}proc join_main {nick uhost hand channel} {global db_handle botnick  if {$nick==$botnick} {return 0}  set sql "UPDATE users SET onirc = 'yes' WHERE username = '$nick'"  putloglev d * "ircstats: executing $sql"  set result [mysqlexec $db_handle $sql]  if {$result != 1} {    putlog "SQL - error"  } else {     set id [mysqlinsertid $db_handle]     puthelp "PRIVMSG $channel :9 User Online: \002$nick\002 - IRC bonus enabled."     pushmode $channel +v $nick  }}proc part_main {nick uhost hand channel msg} {global db_handle botnick  if {$nick==$botnick} {return 0}  set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"  putloglev d * "ircstats: executing $sql"  set result [mysqlexec $db_handle $sql]  if {$result != 1} {    putlog "SQL - Error"  } else {     set id [mysqlinsertid $db_handle]     puthelp "PRIVMSG $channel :5 User Offline: \002$nick\002 - IRC bonus disabled"  }}proc nick_main {nick uhost handle channel newnick} {global db_handle botnick#  if {$nick==$botnick} {return 0}  set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"  putloglev d * "ircstats: executing $sql"  set result [mysqlexec $db_handle $sql]  if {$result != 1} {    set sql "UPDATE users SET onirc = 'yes' WHERE username = '$newnick'"    putloglev d * "ircstats: executing $sql"    set result [mysqlexec $db_handle $sql]    putlog "SQL - Error"    if {$result != 1} {      putlog "SQL - Error"    } else {       set id [mysqlinsertid $db_handle]       puthelp "PRIVMSG $channel :9 User Online \002$newnick\002 - IRC bonus enabled"       pushmode $channel +v $newnick    }  } else {     set id [mysqlinsertid $db_handle]     puthelp "PRIVMSG $channel :5 User Offline \002$nick\002 - IRC bonus disabled"     pushmode -v $newnick  }}</code></pre></div>Stand alone script.<br><div class="codebox"><p>Code: </p><pre><code>load /usr/lib/mysqltcl-2.30/libmysqltcl2.30.sopackage require mysqltclset vdb_handle [mysqlconnect -host localhost -socket /var/run/mysqld/mysqld.sock -user user -password pass -db database]bind join - "#channel *" vjoin_mainbind nick - "#channel *" vnick_mainproc vjoin_main {nick uhost hand channel} {  global vdb_handle botnick  if {$nick==$botnick} {return 0}  set nickv [mysqlescape $nick]  set sql "SELECT username FROM users WHERE username = '$nickv' LIMIT 1"  putloglev d * "ircstats: executing $sql"  set result [mysqlsel $db_handle $sql -flatlist]  if {[llength [split $result]] == 1} {    pushmode $chan +v $nick  }}proc vnick_main {nick uhost handle channel newnick} {  global vdb_handle botnick  if {$newnick==$botnick} {return 0}  set sql "SELECT username FROM users WHERE username = '[mysqlescape $newnick]' LIMIT 1"  putloglev d * "ircstats: executing $sql"  set result [mysqlsel $db_handle $sql -flatlist]  if {[llength [split $result1]] == 1} {    pushmode $chan +v $newnick  } else {    pushmode $chan -v $newnick  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5073">DayCuts</a> — Sat Apr 07, 2007 2:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[traxwriter]]></name></author>
		<updated>2007-03-29T10:42:31-04:00</updated>

		<published>2007-03-29T10:42:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71675#p71675</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71675#p71675"/>
		<title type="html"><![CDATA[Voice user if in MYSQL db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71675#p71675"><![CDATA[
Hi,<br><br>I'm looking for a script that will voice a user if their name is in a mysql db<br><br>if they are not in the db print "Please use your site name to gain your IRC bonus $username"<br><br>Thanks in advance<br><br>I have a irc idle script I wondder if I could integrate into that:<br><div class="codebox"><p>Code: </p><pre><code>load /usr/lib/mysqltcl-2.30/libmysqltcl2.30.sopackage require mysqltclset db_handle [mysqlconnect -host localhost -socket /var/run/mysqld/mysqld.sock -user user -password pass -db database]bind join - "#channel *" join_mainbind part - "#channel *" part_mainbind sign - "#channel *" sign_mainbind nick - "#channel *" nick_mainproc sign_main {nick uhost hand channel reason} {global db_handle botnick  if {$nick==$botnick} {return 0}  set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"  putloglev d * "ircstats: executing $sql"  set result [mysqlexec $db_handle $sql]  if {$result != 1} {    putlog "SQL - Error"  } else {     set id [mysqlinsertid $db_handle]     puthelp "PRIVMSG $channel :5 User Offline: \002$nick\002 - IRC bonus disabled"  }}proc join_main {nick uhost hand channel} {global db_handle botnick  if {$nick==$botnick} {return 0}  set sql "UPDATE users SET onirc = 'yes' WHERE username = '$nick'"  putloglev d * "ircstats: executing $sql"  set result [mysqlexec $db_handle $sql]  if {$result != 1} {    putlog "SQL - error"  } else {     set id [mysqlinsertid $db_handle]     puthelp "PRIVMSG $channel :9 User Online: \002$nick\002 - IRC bonus enabled."  }}proc part_main {nick uhost hand channel msg} {global db_handle botnick  if {$nick==$botnick} {return 0}  set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"  putloglev d * "ircstats: executing $sql"  set result [mysqlexec $db_handle $sql]  if {$result != 1} {    putlog "SQL - Error"  } else {     set id [mysqlinsertid $db_handle]     puthelp "PRIVMSG $channel :5 User Offline: \002$nick\002 - IRC bonus disabled"  }}proc nick_main {nick uhost handle channel newnick} {global db_handle botnick#  if {$nick==$botnick} {return 0}  set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"  putloglev d * "ircstats: executing $sql"  set result [mysqlexec $db_handle $sql]  if {$result != 1} {    set sql "UPDATE users SET onirc = 'yes' WHERE username = '$newnick'"    putloglev d * "ircstats: executing $sql"    set result [mysqlexec $db_handle $sql]    putlog "SQL - Error"    if {$result != 1} {      putlog "SQL - Error"    } else {       set id [mysqlinsertid $db_handle]       puthelp "PRIVMSG $channel :9 User Online \002$newnick\002 - IRC bonus enabled"    }  } else {     set id [mysqlinsertid $db_handle]     puthelp "PRIVMSG $channel :5 User Offline \002$nick\002 - IRC bonus disabled"  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8835">traxwriter</a> — Thu Mar 29, 2007 10:42 am</p><hr />
]]></content>
	</entry>
	</feed>
