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

	<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>2010-01-28T23:09:58-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2010-01-28T23:09:58-04:00</updated>

		<published>2010-01-28T23:09:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91887#p91887</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91887#p91887"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91887#p91887"><![CDATA[
<blockquote class="uncited"><div>The part that matters in the script below is the proc pColorRandom which, when called with a &lt;text&gt; argument, will return the text with randomly coloured foreground/background. A while loop is used to ensure that the foreground color cannot be the same as the background color.<br><br>A public command with syntax !color &lt;text&gt; has been provided to demonstrate.<br><div class="codebox"><p>Code: </p><pre><code>bind PUB - !color pColorCommandproc pColorCommand {nick uhost hand chan text} {    if {[llength [split [string trim $text]]] != 0} {        putserv "PRIVMSG $chan :[pColorRandom $text]"    } else {putserv "PRIVMSG $chan :usage !color &lt;text&gt;"}    return 0}proc pColorRandom {text} {    set fore [set back 00]    while {[string equal $fore $back]} {        set fore [format %02s [rand 16]]        set back [format %02s [rand 16]]    }    return \003${fore},$back$text\003}</code></pre></div>The following script behaves in a similar fashion but colors all the words of the &lt;text&gt; argument differently.<br><div class="codebox"><p>Code: </p><pre><code>bind PUB - !color pColorCommandproc pColorCommand {nick uhost hand chan text} {    if {[llength [split [string trim $text]]] != 0} {        putserv "PRIVMSG $chan :[pColorRandom $text]"    } else {putserv "PRIVMSG $chan :usage !color &lt;text&gt;"}    return 0}proc pColorRandom {text} {    foreach word [split $text] {        set fore [set back 00]        while {[string equal $fore $back]} {            set fore [format %02s [rand 16]]            set back [format %02s [rand 16]]        }        lappend newtext \003${fore},$back$word\003    }    return [join $newtext]}</code></pre></div></div></blockquote>Both of the scripts doesnt working well, tested already bro arfer?<div class="codebox"><p>Code: </p><pre><code>bind PUB - !color pColorCommandproc pColorCommand {nick uhost hand chan text} {    if {[llength [split [string trim $text]]] != 0} {        putserv "PRIVMSG $chan :[pColorRandom $text]"    } else {putserv "PRIVMSG $chan :usage !color &lt;text&gt;"}    return 0}proc pColorRandom {text} { set str2 "" foreach token [split $text ""] {  set rdm [expr {[rand 15]+1}]  set rdm1 [expr {[rand 15]+1}]  if {$rdm1 &lt; 10} { set rdm1 0$rdm1 }  if {$rdm &lt; 10} { set rdm 0$rdm }  if {$rdm == $rdm1} { set rdm1 [expr $rdm1+1]}  if {$token != " "} {   append str2 \003${rdm},${rdm1}$token\003  } {   append str2 $token  } } set str2}</code></pre></div>that's working well<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Thu Jan 28, 2010 11:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2010-01-26T12:31:58-04:00</updated>

		<published>2010-01-26T12:31:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91858#p91858</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91858#p91858"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91858#p91858"><![CDATA[
The part that matters in the script below is the proc pColorRandom which, when called with a &lt;text&gt; argument, will return the text with randomly coloured foreground/background. A while loop is used to ensure that the foreground color cannot be the same as the background color.<br><br>A public command with syntax !color &lt;text&gt; has been provided to demonstrate.<br><div class="codebox"><p>Code: </p><pre><code>bind PUB - !color pColorCommandproc pColorCommand {nick uhost hand chan text} {    if {[llength [split [string trim $text]]] != 0} {        putserv "PRIVMSG $chan :[pColorRandom $text]"    } else {putserv "PRIVMSG $chan :usage !color &lt;text&gt;"}    return 0}proc pColorRandom {text} {    set fore [set back 00]    while {[string equal $fore $back]} {        set fore [format %02s [rand 16]]        set back [format %02s [rand 16]]    }    return \003${fore},$back$text\003}</code></pre></div>The following script behaves in a similar fashion but colors all the words of the &lt;text&gt; argument differently.<br><div class="codebox"><p>Code: </p><pre><code>bind PUB - !color pColorCommandproc pColorCommand {nick uhost hand chan text} {    if {[llength [split [string trim $text]]] != 0} {        putserv "PRIVMSG $chan :[pColorRandom $text]"    } else {putserv "PRIVMSG $chan :usage !color &lt;text&gt;"}    return 0}proc pColorRandom {text} {    foreach word [split $text] {        set fore [set back 00]        while {[string equal $fore $back]} {            set fore [format %02s [rand 16]]            set back [format %02s [rand 16]]        }        lappend newtext \003${fore},$back$word\003    }    return [join $newtext]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Jan 26, 2010 12:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2010-01-26T05:25:16-04:00</updated>

		<published>2010-01-26T05:25:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91855#p91855</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91855#p91855"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91855#p91855"><![CDATA[
<blockquote class="uncited"><div>You can use this proc, which is much faster:<div class="codebox"><p>Code: </p><pre><code>proc randomcolors str { set str2 "" foreach token [split $str ""] {  set rdm [expr {[rand 15]+1}]  if {$rdm &lt; 10} { set rdm 0$rdm }  if {$token != " "} {   append str2 \003${rdm}$token\003  } {   append str2 $token  } } set str2}</code></pre></div></div></blockquote>Bro Sir_Fz, how to make it with random background aswell? offcourse will never same color with background. Thanks alot<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Tue Jan 26, 2010 5:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-03-26T08:31:14-04:00</updated>

		<published>2006-03-26T08:31:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61407#p61407</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61407#p61407"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61407#p61407"><![CDATA[
You can use this proc, which is much faster:<div class="codebox"><p>Code: </p><pre><code>proc randomcolors str { set str2 "" foreach token [split $str ""] {  set rdm [expr {[rand 15]+1}]  if {$rdm &lt; 10} { set rdm 0$rdm }  if {$token != " "} {   append str2 \003${rdm}$token\003  } {   append str2 $token  } } set str2}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Mar 26, 2006 8:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2006-03-25T23:03:34-04:00</updated>

		<published>2006-03-25T23:03:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61400#p61400</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61400#p61400"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61400#p61400"><![CDATA[
Thank you verymuch bro Sir_fz<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Sat Mar 25, 2006 11:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-03-25T06:14:46-04:00</updated>

		<published>2006-03-25T06:14:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61377#p61377</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61377#p61377"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61377#p61377"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc randomcolors str { set str2 "" for {set i 0} {$i&lt;[llength [split $str ""]]} {incr i} {  set rdm [expr {[rand 15]+1}]  if {$rdm &lt; 10} { set rdm 0$rdm }  if {[set token [string index $str $i]] != " "} {   append str2 \003${rdm}$token\003  } {   append str2 $token  } } set str2}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Mar 25, 2006 6:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2006-03-25T05:49:44-04:00</updated>

		<published>2006-03-25T05:49:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61376#p61376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61376#p61376"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61376#p61376"><![CDATA[
i cant used it on "numbering" ?? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Sat Mar 25, 2006 5:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-03-23T22:14:29-04:00</updated>

		<published>2006-03-23T22:14:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61346#p61346</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61346#p61346"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61346#p61346"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc randomcolors str { set str2 "" for {set i 0} {$i&lt;[llength [split $str ""]]} {incr i} {  set rdm [expr {[rand 15]+1}]  if {[set token [string index $str $i]] != " "} {   append str2 \003${rdm}$token\003  } {   append str2 $token  } } set str2}</code></pre></div>Usage:<blockquote class="uncited"><div>set string [randomcolors $string]</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Mar 23, 2006 10:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2006-03-23T20:15:00-04:00</updated>

		<published>2006-03-23T20:15:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61341#p61341</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61341#p61341"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61341#p61341"><![CDATA[
i mean, each caracter will be automatically random the color.<br>says "botnick" , character "b" "o" "t" "n" "i" "c" &amp; "k". will be random eachother &amp; never same color.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Thu Mar 23, 2006 8:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-03-23T09:39:47-04:00</updated>

		<published>2006-03-23T09:39:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61319#p61319</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61319#p61319"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61319#p61319"><![CDATA[
<blockquote class="uncited"><div>How to made each character from words be different the colour?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"></div></blockquote>All is revealed in <a href="http://forum.egghelp.org/viewtopic.php?t=3867" class="postlink">Colour and formatting codes</a>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Mar 23, 2006 9:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2006-03-23T05:48:16-04:00</updated>

		<published>2006-03-23T05:48:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61313#p61313</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61313#p61313"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61313#p61313"><![CDATA[
How to made each character from words be different the colour?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Thu Mar 23, 2006 5:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2005-08-13T02:43:46-04:00</updated>

		<published>2005-08-13T02:43:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=54163#p54163</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=54163#p54163"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=54163#p54163"><![CDATA[
it's working now..<br>thank you guys<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Sat Aug 13, 2005 2:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-08-12T18:15:52-04:00</updated>

		<published>2005-08-12T18:15:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=54137#p54137</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=54137#p54137"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=54137#p54137"><![CDATA[
<blockquote class="uncited"><div>0 being nothing is probably why he adds 1 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>There are actually 16 colours, not 15!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Fri Aug 12, 2005 6:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-08-12T13:33:11-04:00</updated>

		<published>2005-08-12T13:33:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=54122#p54122</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=54122#p54122"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=54122#p54122"><![CDATA[
Actually 0 is for white, so I thought he might wanna use it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Aug 12, 2005 1:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2005-08-12T12:16:06-04:00</updated>

		<published>2005-08-12T12:16:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=54121#p54121</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=54121#p54121"/>
		<title type="html"><![CDATA[help wih colour]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=54121#p54121"><![CDATA[
0 being nothing is probably why he adds 1 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Fri Aug 12, 2005 12:16 pm</p><hr />
]]></content>
	</entry>
	</feed>
