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

	<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-03-22T10:15:49-04:00</updated>

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

		<entry>
		<author><name><![CDATA[garfwen]]></name></author>
		<updated>2009-03-22T10:15:49-04:00</updated>

		<published>2009-03-22T10:15:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88017#p88017</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88017#p88017"/>
		<title type="html"><![CDATA[Need help &quot;[ ] { } ' - /&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88017#p88017"><![CDATA[
Yep.<br><br>Thank you<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9777">garfwen</a> — Sun Mar 22, 2009 10:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-03-22T10:03:46-04:00</updated>

		<published>2009-03-22T10:03:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88016#p88016</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88016#p88016"/>
		<title type="html"><![CDATA[Need help &quot;[ ] { } ' - /&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88016#p88016"><![CDATA[
Ahh, I do see some unbalanced {}'s but that's probably due to your trimming.<br><br>The error at hand however, is that you use the -list option with ::mysql::sel. This makes it return a tcl-list of results, and you'll have to use lindex to retrieve a single item, or join to convert the list into a string.<br><br>Fix: change each ::mysql::sel-command like below:<div class="codebox"><p>Code: </p><pre><code>#This...if {[::mysql::sel $db "SELECT password FROM users WHERE auth='$auth'" -list] == $pass } {#Should be changed into this...if {[join [::mysql::sel $db "SELECT password FROM users WHERE auth='$auth'" -list]] == $pass } {#This...set check [::mysql::sel $db "SELECT ircstatus FROM users WHERE auth='$auth'" -list]#Should be changed into this...set check [join [::mysql::sel $db "SELECT ircstatus FROM users WHERE auth='$auth'" -list]]#And so on...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Mar 22, 2009 10:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[garfwen]]></name></author>
		<updated>2009-03-22T09:18:46-04:00</updated>

		<published>2009-03-22T09:18:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88015#p88015</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88015#p88015"/>
		<title type="html"><![CDATA[Need help &quot;[ ] { } ' - /&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88015#p88015"><![CDATA[
Hello.<br><br>The scripts is a little big, i'll post the "auth" proc:<br><div class="codebox"><p>Code: </p><pre><code>proc auth {nick hand host txt} { global botnick ci cf db mainchan mainchanpvt modeauth if { $modeauth == 1 } {if {[onchan $nick $mainchan]} {if { [::mysql::sel $db "SELECT auth FROM users WHERE ircnick='[string tolower $nick]' AND ircstatus='1'"] == "1" } {puthelp "PRIVMSG $nick :$ci Tu já estas autenticado! $cf" } else {set auth [string tolower [lindex [split $txt] 0]]set pass [md5 [string tolower [lindex [split $txt] 1]]]if { $txt == "" } {puthelp "PRIVMSG $nick :$ci Comando inválido, para te autenticares usa /msg $botnick auth &lt;nick&gt; &lt;pass&gt; $cf" } else {if { $pass == "" } {puthelp "PRIVMSG $nick :$ci Comando inválido, para te autenticares usa /msg $botnick auth &lt;nick&gt; &lt;pass&gt; $cf" } else {if {[::mysql::sel $db "SELECT password FROM users WHERE auth='$auth'" -list] == $pass } {set check [::mysql::sel $db "SELECT ircstatus FROM users WHERE auth='$auth'" -list]if { $check == 1 } {set authednick [::mysql::sel $db "SELECT ircnick FROM users WHERE auth='$auth'" -list]putserv "privmsg $authednick :$ci O utilizador $nick fez auth na tua conta(#$auth). Deixas-te de estar autenticado $cf"}set result [::mysql::exec $db "UPDATE users SET ircstatus='1' WHERE auth='$auth'"]set result [::mysql::exec $db "UPDATE users SET ircnick='$nick' WHERE auth='$auth'"]set level [::mysql::sel $db "SELECT level FROM users WHERE auth='$auth'" -list]puthelp "PRIVMSG $nick :$ci Estás agora autenticado como $auth $cf" set auth [::mysql::sel $db "SELECT auth FROM users WHERE ircnick='$nick' AND ircstatus='1'" -list]}} else {putserv "privmsg $mainchanpvt : Tentativa de login falhado por $nick (Auth: #$auth)"puthelp "PRIVMSG $nick :$ci Password/nick inválido, para te autenticares usa /msg $botnick auth &lt;nick&gt; &lt;pass&gt;  $cf" } }}}} else {puthelp "PRIVMSG $nick :$ci Precisas de estar no canal $mainchan para fazer auth $cf" }} else {puthelp "PRIVMSG $nick :$ci Esta funcão foi desactivada $cf" }}</code></pre></div>( I deleted some code, maybe a } is missing or smthng.)<br><br>That proc checks if your on the chan, checks if your already authed, checks if your login/password exists and also checks if they match acording to de mysql db.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9777">garfwen</a> — Sun Mar 22, 2009 9:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-03-21T21:48:35-04:00</updated>

		<published>2009-03-21T21:48:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88009#p88009</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88009#p88009"/>
		<title type="html"><![CDATA[Need help &quot;[ ] { } ' - /&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88009#p88009"><![CDATA[
Do you think you could post the script?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Mar 21, 2009 9:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[garfwen]]></name></author>
		<updated>2009-03-21T19:35:13-04:00</updated>

		<published>2009-03-21T19:35:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88008#p88008</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88008#p88008"/>
		<title type="html"><![CDATA[Need help &quot;[ ] { } ' - /&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88008#p88008"><![CDATA[
Hello<br><br>I made a simple auth-sistem with mysql. <br>It saves your nickname in a table when you AUTH.<br><br>But i'm having a little trouble with nicknames with [ ] { } ' - /, the bot just dont read them or add some { }.<br><br>Any solution?<br><br>Thanks,<br>GaRfWeN<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9777">garfwen</a> — Sat Mar 21, 2009 7:35 pm</p><hr />
]]></content>
	</entry>
	</feed>
