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

	<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-06-08T18:46:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[w00f]]></name></author>
		<updated>2007-06-08T18:46:25-04:00</updated>

		<published>2007-06-08T18:46:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73356#p73356</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73356#p73356"/>
		<title type="html"><![CDATA[tcl - mysql - qry / output formated to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73356#p73356"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>## CONF ### trigger to searchset srch(cmd) "!pcoords"# SQL infoset sql(host) "IP"set sql(user) "USER"set sql(pass) "PASS-BLA"set sql(db) "DATABASE-NAME"set sql(port) "PORT"## END CONF ##package require mysqltclbind pub - $srch(cmd) pcoordsproc pcoords {nick host hand chan arg} {   global sql   if {[lindex $arg 0] == ""} { putquick "PRIVMSG $chan :\002Syntax\002: $srch(cmd) &lt;user&gt; "       return   }   set search [lindex $arg 0]   set sql(handle) [mysqlconnect -host $sql(host) -user $sql(user) -password $sql(pass) -db $sql(db) -port $sql(port)]   set query [::mysql::query $sql(handle) "SELECT g.galaxy,g.system,g.planet,g.moon,a.allyname,p.playername,a.members FROM galaxy g LEFT JOIN players p ON (g.player_id=p.id) LEFT JOIN alliances a ON (p.alliance_id=a.id) LEFT JOIN notices n ON (g.player_id = n.player_id) LEFT JOIN reports r ON (g.galaxy = r.galaxy AND g.system = r.system AND g.planet = r.planet AND r.moon='false') WHERE p.playername LIKE '$search'  AND (g.player_id &gt; 0) ORDER BY galaxy,system,planet ASC  LIMIT 0,20"]   if {[::mysql::result $query rows] &lt; 1} {       set output "User \002\00307$search\017 does not exist.."   } else {       set count 1       while {[set row [::mysql::fetch $query]] != ""} {       set galaxy [lindex $row 0]       set system [lindex $row 1]       set planet [lindex $row 2]       set gotmoon [lindex $row 3]       if {[string match -nocase $gotmoon "true"]} { set moon "\[M]"        } else { set moon "\[NO]" }       set allyn [lindex $row 4]       set playern [lindex $row 5]       set members [lindex $row 6]              if {$count == 1} { set output "\002Coords of Player\017: $playern \00314~\017\002 Ally\017: $allyn ($members) : $galaxy:$system:$planet $moon "       incr count       } else { [lappend output "\| $galaxy:$system:$planet $moon "] }       }   }putquick "PRIVMSG $chan:$output "::mysql::endquery $querymysqlclose $sql(handle)}putlog "pcoords.tcl loaded" </code></pre></div><br>something like this.<br>untested ofc.<br><br>~w00f<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8264">w00f</a> — Fri Jun 08, 2007 6:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Cidem]]></name></author>
		<updated>2007-06-08T17:39:34-04:00</updated>

		<published>2007-06-08T17:39:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73355#p73355</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73355#p73355"/>
		<title type="html"><![CDATA[tcl - mysql - qry / output formated to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73355#p73355"><![CDATA[
woot ...nice  thx for the link...<br><br>ok i did the first parts you told me but if it comes to the lappend part i just dont know how to change this in the while part <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9047">Cidem</a> — Fri Jun 08, 2007 5:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[w00f]]></name></author>
		<updated>2007-06-08T13:51:08-04:00</updated>

		<published>2007-06-08T13:51:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73353#p73353</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73353#p73353"/>
		<title type="html"><![CDATA[tcl - mysql - qry / output formated to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73353#p73353"><![CDATA[
check <a href="http://forum.egghelp.org/viewtopic.php?t=13411&amp;highlight=sql" class="postlink"><strong class="text-strong">this</strong></a> topic.<br><br>change the cmd, db info, sql query, and use <a href="http://tmml.sourceforge.net/doc/tcl/lappend.html" class="postlink"><em class="text-italics">lappend</em></a> to set the output inside the "while".<br><br>~w00f<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8264">w00f</a> — Fri Jun 08, 2007 1:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Cidem]]></name></author>
		<updated>2007-06-07T16:58:19-04:00</updated>

		<published>2007-06-07T16:58:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73338#p73338</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73338#p73338"/>
		<title type="html"><![CDATA[tcl - mysql - qry / output formated to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73338#p73338"><![CDATA[
hello there,<br><br>i am in need of help,<br>i need a script that outputs the result of an mysql qry:<br><div class="codebox"><p>Code: </p><pre><code>SELECT g.galaxy,g.system,g.planet,g.moon,a.allyname,p.playername,a.members FROM galaxy g LEFT JOIN players p ON (g.player_id=p.id) LEFT JOIN alliances a ON (p.alliance_id=a.id) LEFT JOIN notices n ON (g.player_id = n.player_id) LEFT JOIN reports r ON (g.galaxy = r.galaxy AND g.system = r.system AND g.planet = r.planet AND r.moon='false')  WHERE p.playername LIKE 'ilovecc'  AND (g.player_id &gt; 0)   ORDER BY galaxy,system,planet ASC  LIMIT 0,20</code></pre></div>result:<div class="codebox"><p>Code: </p><pre><code>galaxy system planet moon allyname playername members1 353 8 true FN ILoveCC 252 474 11 true FN ILoveCC 253 111 4 true FN ILoveCC 254 474 4 true FN ILoveCC 255 200 4 true FN ILoveCC 256 279 4 true FN ILoveCC 257 234 4 true FN ILoveCC 258 234 4 true FN ILoveCC 259 377 7 false FN ILoveCC 25</code></pre></div>to something like this on irc:<br><br>Coords of Player: ILoveCC - Ally: FN (25) :   1:353:8 [M]  |  2:474:11 [M] |  3:111:4 [M]... and so on ..   <br><br>"!pcoords IloveCC"    should be the way one can request this ..from the channel<br><br>i hope someone is willing &amp; capable to help me out with this cause i got no clue how to format that mysql output and bring it to irc ...<br><br><br>if you need additional infos ...pls ask ..<br>also pls excuse my bad written english <br><br>thx...<br><br>Cidem<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9047">Cidem</a> — Thu Jun 07, 2007 4:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
