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

	<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>2011-02-16T14:20:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rickity]]></name></author>
		<updated>2011-02-16T14:20:26-04:00</updated>

		<published>2011-02-16T14:20:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96053#p96053</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96053#p96053"/>
		<title type="html"><![CDATA[private channel user checked against mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96053#p96053"><![CDATA[
works brilliantly ty so much  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11551">rickity</a> — Wed Feb 16, 2011 2:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-02-16T14:01:45-04:00</updated>

		<published>2011-02-16T14:01:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96052#p96052</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96052#p96052"/>
		<title type="html"><![CDATA[private channel user checked against mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96052#p96052"><![CDATA[
A few things..<br>Don't use "args" as an argument name unless you know what you are doing. Unless you intend to re-use the proc for other bindings such as pub and/or pubm, there'd be no point in using it here.<div class="codebox"><p>Code: </p><pre><code>proc joins {nick host hand chan} {</code></pre></div>$chan == $userChan<br>This test is case-sensitive, and the value of $chan is whatever the user used to join the channel. Irc-servers on the other hand, treat channel-names in a case-insensitive manner; #test and #Test is the same channel. Use the "string" command instead:<div class="codebox"><p>Code: </p><pre><code>if {[string equal -nocase -- $chan $userChan]} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Feb 16, 2011 2:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rickity]]></name></author>
		<updated>2011-02-16T13:28:20-04:00</updated>

		<published>2011-02-16T13:28:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96051#p96051</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96051#p96051"/>
		<title type="html"><![CDATA[private channel user checked against mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96051#p96051"><![CDATA[
i manged to work it out thanks to your help<br>im over the moon <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><div class="codebox"><p>Code: </p><pre><code>package require mysqltcl#-&gt; Change the information below to connect to your MySQL databaseset mysqlserver localhost;set mysqluser ***;set mysqlpwd ***;set mysqldb ***;#-&gt; Change the chan below for the chan you wish to monitorset userChan "#test"bind join - * joinsproc joins {nick host hand chan args} {        global userChan        if {$chan == $userChan } {               set db_handle [mysqlconnect -h  $::mysqlserver -u $::mysqluser -password $::mysqlpwd];                mysqluse $db_handle $::mysqldb   set sql "SELECT id FROM users WHERE username='[mysqlescape $nick]'"    set result [mysqlsel $db_handle $sql -list]                        }set result [mysqlsel $db_handle $sql -list]if {$result &gt; 0 } { putserv "NOTICE $userChan $nick :welcome"} else {putserv "kick $userChan $nick :your names not down your not comming in!"mysqlclose $db_handle;}} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11551">rickity</a> — Wed Feb 16, 2011 1:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-02-14T13:55:31-04:00</updated>

		<published>2011-02-14T13:55:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96014#p96014</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96014#p96014"/>
		<title type="html"><![CDATA[private channel user checked against mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96014#p96014"><![CDATA[
First off, it would seem that you forgot to place your code as part of a proc declaration:<div class="codebox"><p>Code: </p><pre><code>proc procname {argument list here} {  code here...}</code></pre></div>Secondly, your script lacks a binding to trigger this proc. I would assume you'd like the check to be done as a user joins the channel; so thus you need to use the join-binding:<br>bind join - "#test *" procname<br>You'll also have to make sure that your proc accepts the proper parameters (see the argument list). Join bindings pass the following parameters to the proc when it triggers: nickname, user@host, handle, channel<div class="codebox"><p>Code: </p><pre><code>proc procname {nick host handle channel} {  code goes here...}</code></pre></div>Thirdly, "MODE +k $nick" is not a valid MODE command. The first parameter is expected to be the target; either a channel name, or the name of the bot. In your case, this would probably be the channel. Next, the +k mode is channel key, not kick/ban/etc. I doubt you intended to lock the channel with the offender's nickname as key/password, but rather you intended to ban him/her. Use +b mode along with a proper banmask for this instead.<br><br>Passing the -list option to mysqlsel causes it to return a list of Result Sets. Doing a simple less-then/greater-then check is technically not correct, though I think you'll get away with it in this case.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Feb 14, 2011 1:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rickity]]></name></author>
		<updated>2011-02-13T21:34:58-04:00</updated>

		<published>2011-02-13T21:34:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96010#p96010</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96010#p96010"/>
		<title type="html"><![CDATA[private channel user checked against mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96010#p96010"><![CDATA[
hi <br>   im trying to make a script so the eggdrop checks against a mysql db <br>if a user that is not in the database tries to enter the room he/she is kicked<br><br>ive been trying to modify a script all is good except when it comes to executing the kick ,or welcoming a member into the room.<br><div class="codebox"><p>Code: </p><pre><code>package require mysqltcl###### Set Site address ###########################set site_add "http://www.******"###### Setup Your database info here ##############set dbuser "****"set dbpassword "****"set name "****"set portno "3306"##### Set site channels ##########################set chanmember "#test"set memberclassno "1"################################################### Connect to Database ###################################################set db_handle [mysqlconnect -host localhost -port $portno -user $dbuser -password $dbpassword -db $name]################################################### ###################################################global db_handle chanmember set sql "SELECT  id FROM users WHERE username='[mysqlescape $nick]'"set result [mysqlsel $db_handle $sql -list]if {$result &gt; 1} {putserv "NOTICE $nick :welcome to $nick to the members IRC-Channel!"} else {}if {$result &lt; 1} {putserv "MODE +k $nick" putserv "NOTICE KICK $nick :your names not down your not comming in" mysqlendquery $db_handle}</code></pre></div>any help would be appreciated ty<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11551">rickity</a> — Sun Feb 13, 2011 9:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
