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

	<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-02-10T07:41:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[dragoneye]]></name></author>
		<updated>2007-02-10T07:41:53-04:00</updated>

		<published>2007-02-10T07:41:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70366#p70366</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70366#p70366"/>
		<title type="html"><![CDATA[problem with list / mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70366#p70366"><![CDATA[
thx again...well im learning more about tcl all the time <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> but  sometimes i need little help :L<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6114">dragoneye</a> — Sat Feb 10, 2007 7:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2007-02-09T17:16:51-04:00</updated>

		<published>2007-02-09T17:16:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70337#p70337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70337#p70337"/>
		<title type="html"><![CDATA[problem with list / mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70337#p70337"><![CDATA[
<blockquote class="uncited"><div>why dosent that work :L</div></blockquote>because you do alot of weird stuff that doesn't make sense (like adding random brackets) <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> Here's some weird stuff that works:<div class="codebox"><p>Code: </p><pre><code>set win [set draw [set lose 0]]foreach {a b} [split [set vs][set vs {}] "- "] {lappend vs [if {$a&gt;$b} {incr winlist \00303} elseif {$a==$b} {incr drawlist \00312} else {incr loselist \00304}]$a-$b}set vs [join $vs]</code></pre></div>You should read and understand this page <a href="http://tcl.tk/man/tcl8.4/TclCmd/Tcl.htm" class="postlink">http://tcl.tk/man/tcl8.4/TclCmd/Tcl.htm</a> before trying to code any more. It will save you alot of trouble to know the syntax.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Feb 09, 2007 5:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dragoneye]]></name></author>
		<updated>2007-02-09T15:43:09-04:00</updated>

		<published>2007-02-09T15:43:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70334#p70334</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70334#p70334"/>
		<title type="html"><![CDATA[problem with list / mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70334#p70334"><![CDATA[
well im trying <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> but not good with this kinda thingie <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><div class="codebox"><p>Code: </p><pre><code> foreach {a b} [split [set vs][set vs ""] "- "] {   lappend vs [expr {$a&gt;$b?"\00303":($a==$b?"\00312":"\00304")}]$a-$bif { $a&gt;$b } { [incr win 1] }if { $a==$b } { [incr draw 1] }if { $a&lt;$b } { [incr lose 1] } }</code></pre></div>why dosent that work :L<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6114">dragoneye</a> — Fri Feb 09, 2007 3:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2007-02-09T15:29:41-04:00</updated>

		<published>2007-02-09T15:29:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70333#p70333</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70333#p70333"/>
		<title type="html"><![CDATA[problem with list / mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70333#p70333"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>set win "0"set draw "0"set lose "0"foreach {a b} [split [set vs][set vs ""] "- "] {   lappend vs [expr {$a&gt;$b?"[incr lose 1]":($a==$b?"[incr lose 1]":"[incr lose 1]")}]$a-$b }</code></pre></div></div></blockquote>you 'incr lose' no matter what...and destroy the value of vs in the process... try to think <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Feb 09, 2007 3:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dragoneye]]></name></author>
		<updated>2007-02-09T15:14:21-04:00</updated>

		<published>2007-02-09T15:14:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70332#p70332</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70332#p70332"/>
		<title type="html"><![CDATA[problem with list / mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70332#p70332"><![CDATA[
well how can i make the script add wins losses and draws ? <br>i tried this but didnt get it to work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br><div class="codebox"><p>Code: </p><pre><code>set win "0"set draw "0"set lose "0"foreach {a b} [split [set vs][set vs ""] "- "] {   lappend vs [expr {$a&gt;$b?"[incr lose 1]":($a==$b?"[incr lose 1]":"[incr lose 1]")}]$a-$b }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6114">dragoneye</a> — Fri Feb 09, 2007 3:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dragoneye]]></name></author>
		<updated>2007-02-09T14:30:55-04:00</updated>

		<published>2007-02-09T14:30:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70329#p70329</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70329#p70329"/>
		<title type="html"><![CDATA[problem with list / mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70329#p70329"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>foreach {a b} [split [set vs][set vs ""] "- "] {lappend vs [expr {$a&gt;$b?"\00303":($a==$b?"\00312":"\00304")}]$a-$b}set vs [join $vs]</code></pre></div>EDIT: moved the \003 to prevent expr messing up the return values</div></blockquote>again man you rock <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> thx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6114">dragoneye</a> — Fri Feb 09, 2007 2:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2007-02-09T14:31:01-04:00</updated>

		<published>2007-02-09T14:21:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70328#p70328</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70328#p70328"/>
		<title type="html"><![CDATA[problem with list / mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70328#p70328"><![CDATA[
Please don't edit your post and change all of it (my original answer here stopped making sense because I didn't quote you)<br><br>Here is the answer to your edited question:<div class="codebox"><p>Code: </p><pre><code>foreach {a b} [split [set vs][set vs ""] "- "] {lappend vs [expr {$a&gt;$b?"\00303":($a==$b?"\00312":"\00304")}]$a-$b}set vs [join $vs]</code></pre></div>EDIT: moved the \003 to prevent expr messing up the return values<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Feb 09, 2007 2:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dragoneye]]></name></author>
		<updated>2007-02-09T12:50:50-04:00</updated>

		<published>2007-02-09T12:06:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70322#p70322</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70322#p70322"/>
		<title type="html"><![CDATA[problem with list / mysql]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70322#p70322"><![CDATA[
i want to put colors to my scores like if 1-0 then green if 0-1 red and 1-1 blue<br><div class="codebox"><p>Code: </p><pre><code>proc cws {nick uhost hand chan arg} {if { [isop $nick $chan] } {global dbhost dbuser dbpass dbname mycpage matchtab mytag pchan if {$arg == ""} { putnotc $nick "\[\2cw's\2\] syntax: !cws clantag";return 1 } set mysql(conn) [mysqlconnect -host $dbhost -user $dbuser -password $dbpass -db $dbname] set arg [string map {' ''} $arg] set rows [mysqlsel $mysql(conn) "select count(*) FROM `matches` WHERE `opponent` = '$arg' " -list ] set vs [mysqlsel $mysql(conn) "SELECT `score` FROM `matches` WHERE `opponent` = '$arg' " -flatlist ] set clname [mysqlsel $mysql(conn) "SELECT `cname` FROM `tagit` WHERE `tagi` = '$arg' " -flatlist ] set irc [mysqlsel $mysql(conn) "SELECT `ircchan` FROM `tagit` WHERE `tagi` = '$arg' " -list ] set hp [mysqlsel $mysql(conn) "SELECT `http` FROM `tagit` WHERE `tagi` = '$arg' " -list ] set cname [lindex $clname 0] if { $rows == 0 } {putmsg $chan "\[\2cw's\2\] no cw's played against \2$arg\2.";return 0} putmsg $chan "\[\2$arg \2•\2 $cname \2•\2 $irc \2\]" putmsg $chan "\[\2Homepage:\2 $hp \]" putmsg $chan "\[\2cw's\2\] $vs. Total $rows cw's against \2$arg" } else {    puthelp "NOTICE $nick : You need to be OP to use this command"  }}</code></pre></div>current output is like this, but how can i add those colors :L and maybe <br>put something like wins: x loses: x draws: x<br><br>[w/ • whatever • #clan.w ]<br>[Homepage: <a href="http://hangar.0wns.org/whatever/" class="postlink">http://hangar.0wns.org/whatever/</a> ]<br>[cw's] 25-19 32-23 24-21 28-19 29-21 36-10 25-23 31-16 25-22 24-21 21-28 21-23 38-22 31-16 24-21 30-19 27-32 28-22 23-31 21-31 21-24 20-27 21-36 22-27 30-12 26-32 28-27 23-35 28-29 28-32 26-24 27-27 19-39. Total 33 cw's against w/<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6114">dragoneye</a> — Fri Feb 09, 2007 12:06 pm</p><hr />
]]></content>
	</entry>
	</feed>
