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

	<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>2002-12-06T10:56:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Photon]]></name></author>
		<updated>2002-12-06T10:56:53-04:00</updated>

		<published>2002-12-06T10:56:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14052#p14052</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14052#p14052"/>
		<title type="html"><![CDATA[Join script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14052#p14052"><![CDATA[
LMAO  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><br>Remind me in future to let Slim do the explaining....<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1824">Photon</a> — Fri Dec 06, 2002 10:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-12-06T10:19:44-04:00</updated>

		<published>2002-12-06T10:19:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14051#p14051</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14051#p14051"/>
		<title type="html"><![CDATA[Join script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14051#p14051"><![CDATA[
Ok thanks guys <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> Much MUCH appreciated. I get it now. Thankyou <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by Guest — Fri Dec 06, 2002 10:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-06T10:13:20-04:00</updated>

		<published>2002-12-06T10:13:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14050#p14050</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14050#p14050"/>
		<title type="html"><![CDATA[Join script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14050#p14050"><![CDATA[
The if command works on boolien values. IE, smthing is TRUE or FALSE, 1 or 0, it matches or it doesn't match.<br><br>In th 1 or 0 version, it can be extended further, by saying 0 = FALSE and any other value is TRUE.<br><br>The rand command (supplied by eggdrop) produces a random value, of 0 upto LIMIT-1.<br><br>Thus, giving it a value of 5, can give the values 0, 1, 2, 3, 4. This can be represented in boolien as F, T, T, T, T (first letters of false and true)<br><br>Aplying these together, you have a 4 in 5 chance of it being true, and 1 in 5 of false.<br><br>This is obviously the reverse to what you want.<br><br>In the matching system for IF, you also have a negate symbol (!). This will convert TRUE to FALSE, and FLASE to TRUE.<br><br>Thus, the boolien pattern above for the random value becomes T, F, F, F, F. IE, reversing the odds.<br><br>This rather techy way of saying it, but i'm sure you will get the idea.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Fri Dec 06, 2002 10:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Photon]]></name></author>
		<updated>2002-12-06T10:06:11-04:00</updated>

		<published>2002-12-06T10:06:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14049#p14049</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14049#p14049"/>
		<title type="html"><![CDATA[Join script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14049#p14049"><![CDATA[
What it says is if (random number from 0 to 5) is zero then..<br><br>If !(a) will be triggered if a is FALSE i.e. 0 (! = NOT - check boolean algebra)<br><br>Therefore you have a 1 in 6 chance of if being true.<br><br>HTH<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1824">Photon</a> — Fri Dec 06, 2002 10:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-12-06T09:55:34-04:00</updated>

		<published>2002-12-06T09:55:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14048#p14048</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14048#p14048"/>
		<title type="html"><![CDATA[Join script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14048#p14048"><![CDATA[
ppslim: thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">)<br><br>could you please tell me why that works too ? I understand the "rand 5" part, but I can't work out why it works.<br><br>- type<p>Statistics: Posted by Guest — Fri Dec 06, 2002 9:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-05T20:02:58-04:00</updated>

		<published>2002-12-05T20:02:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14021#p14021</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14021#p14021"/>
		<title type="html"><![CDATA[Join script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14021#p14021"><![CDATA[
somthing like<br><div class="codebox"><p>Code: </p><pre><code>if {![rand 5]} { return }</code></pre></div>will work<br><br>This should be placed as the firsty line, and before the data is sent.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Dec 05, 2002 8:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-12-05T18:34:17-04:00</updated>

		<published>2002-12-05T18:34:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14014#p14014</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14014#p14014"/>
		<title type="html"><![CDATA[Join script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14014#p14014"><![CDATA[
Hi peeps.<br><br>I'm quite new to tcl still and I was wondering if anyone could help me out with this problem. <br><br>I want my bot to say Hi or Hello or whatever to anyone who joins a channel, which I have managed to do, but I don't want it to happen EVERY time someone joins, maybe 1:5 ratio. Is there a simple way of  doing this ? Here's the script I have made ...<br><br>Thanks in advance<br><br>- type.<br><br>===================== <br><br><br>bind join - * randgreet<br><br>proc randgreet {nick host hand channel args} {<br>  global library<br>  puthelp "PRIVMSG $channel :\002$nick\002: [lindex $library [rand<br>[llength $library]]]" &lt;--- all one line<br>}<br><br>set library {<br>"Hi"<br>"Hello"<br>"You seen my glasses ?"<br>}<br><br>EOF<p>Statistics: Posted by Guest — Thu Dec 05, 2002 6:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
