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

	<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-01-30T11:57:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-01-30T11:52:43-04:00</updated>

		<published>2007-01-30T11:52:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70080#p70080</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70080#p70080"/>
		<title type="html"><![CDATA[Choose Random Nick From Channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70080#p70080"><![CDATA[
I would still suggest building proper lists using the "list" command, rather than trying to create it by hand. (My example above also solves the problem with not evaluating $randnick.)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Jan 30, 2007 11:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-01-30T11:57:25-04:00</updated>

		<published>2007-01-30T11:49:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70079#p70079</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70079#p70079"/>
		<title type="html"><![CDATA[Choose Random Nick From Channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70079#p70079"><![CDATA[
Also, $randnick will be printed as is since it is being enclosed by {}.<div class="codebox"><p>Code: </p><pre><code>proc text:attack { nick uhost hand chan text } { set nicks [chanlist $chan] set randnick [lindex $nicks [rand [llength $nicks]]] set randmsg [list \  "fires a M16 at $randnick" \  "throws a grenade at $randnick" \  "rolls over $randnick with a tank"] set action [lindex $randmsg [rand [llength $randmsg]]] putserv "PRIVMSG $chan :\001ACTION $action\001"}</code></pre></div>Edit: Indeed, I somehow missed it in your post nml375 <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=3085">Sir_Fz</a> — Tue Jan 30, 2007 11:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-01-30T10:32:59-04:00</updated>

		<published>2007-01-30T10:32:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70077#p70077</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70077#p70077"/>
		<title type="html"><![CDATA[Choose Random Nick From Channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70077#p70077"><![CDATA[
Quite obviously, to be honest, since the first character within randmsg is a newline. And since the irc-protocol is newline-terminated, this means the next few rows will be treated separate commands - not part of the privmsg. You probably want something like this:<br><div class="codebox"><p>Code: </p><pre><code>set randmsg [list "fires a M16 at $randnick" "throws a grenade at $randnick" "rolls over $randnick with a tank"]set action [lindex $randmsg [rand [llength $randmsg]]]</code></pre></div>And then use $action instead of $randmsg when you wish to send a random attack.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Jan 30, 2007 10:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Molitov]]></name></author>
		<updated>2007-01-30T10:09:46-04:00</updated>

		<published>2007-01-30T10:09:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70076#p70076</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70076#p70076"/>
		<title type="html"><![CDATA[Choose Random Nick From Channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70076#p70076"><![CDATA[
thanks heaps dwickie =) (was a missing ] though =o)<br><br>now i have had a quick look at the forums on how to choose a random setting from a list.<div class="codebox"><p>Code: </p><pre><code>proc text:attack { nick uhost hand chan text } {set nicks [chanlist $chan]set randnick [lindex $nicks [rand [llength $nicks]]]set randmsg {"fires a M16 at $randnick""throws a grenade at $randnick""rolls over $randnick with a tank"}putserv "PRIVMSG $chan :\001ACTION $randmsg"}</code></pre></div>that is the code so far and at the moment the bot just comes up with in IRC<br>[23:05:01] -Action- Tehbot<br><br>no errors in party line or anything<br>just a blank action.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8664">Molitov</a> — Tue Jan 30, 2007 10:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dwickie]]></name></author>
		<updated>2007-01-30T09:21:54-04:00</updated>

		<published>2007-01-30T09:21:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70075#p70075</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70075#p70075"/>
		<title type="html"><![CDATA[Choose Random Nick From Channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70075#p70075"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set nicks [chanlist $chan]set randnick [lindex $nicks [rand [llength $nicks]]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5343">dwickie</a> — Tue Jan 30, 2007 9:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Molitov]]></name></author>
		<updated>2007-01-30T08:59:46-04:00</updated>

		<published>2007-01-30T08:59:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70074#p70074</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70074#p70074"/>
		<title type="html"><![CDATA[Choose Random Nick From Channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70074#p70074"><![CDATA[
Hi!<br><br>I have recently started .tcl and finding it fun to a certain degree..... How ever i have recently hit a block, google won't help and even search here didin't seem to help.<br><br>Is there anyway I can get my bot to select a random nick from the channel, and the put it in a PRIVMSG to the channel? (with other text and on command , but its just the grabbing the random nick that I need help with.)<br><br>Help appreciated =)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8664">Molitov</a> — Tue Jan 30, 2007 8:59 am</p><hr />
]]></content>
	</entry>
	</feed>
