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

	<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>2004-12-29T21:28:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-12-29T21:28:26-04:00</updated>

		<published>2004-12-29T21:28:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44718#p44718</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44718#p44718"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44718#p44718"><![CDATA[
sorry right i missed the ! which in this case is verry important .. hehe also if that is the case i have to say u can't use the +1 method cause it will never return 0 = &gt; if the value is 1-20 the if statement will never be true ..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Wed Dec 29, 2004 9:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2004-12-29T08:47:29-04:00</updated>

		<published>2004-12-29T08:47:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44654#p44654</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44654#p44654"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44654#p44654"><![CDATA[
aye your way is great if i wanted to execute something different on a number returned but all i wanted was something to be executed with a 1 in 20 chance which [!rand 20] did perfectly cheers <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=3723">^DooM^</a> — Wed Dec 29, 2004 8:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-12-28T21:44:30-04:00</updated>

		<published>2004-12-28T21:44:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44641#p44641</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44641#p44641"/>
		<title type="html"><![CDATA[Re: lol]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44641#p44641"><![CDATA[
<blockquote class="uncited"><div>Hey guys <br><br>All i needed was a small easy way to make my bot kick someone with a 1 in 20 chance of them triggering the proc kinda a russian roulette thing so 0 - 19 or 1 - 20 would do exactly the same thing at the end of the day thanks again for your replys <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> hope you all had a good xmas.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"></div></blockquote>easyest way is to use switch<br><div class="codebox"><p>Code: </p><pre><code>switch  -- [rand 20] {  "0" {    # code   }  "1" {    # code   }  "2" {    # code  }  #... i gues you get the picture ..}</code></pre></div>or ..<br><div class="codebox"><p>Code: </p><pre><code>switch  -regexp [rand 20] {  "(0|3|6)" {    # code   }  "(1|4|7)" {    # code   }  "(2|5|8)" {    # code  }}</code></pre></div>if you don't have that mutch conditions.. to shorten the code.. don't see the use but hell..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Tue Dec 28, 2004 9:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2004-12-27T08:08:56-04:00</updated>

		<published>2004-12-27T08:08:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44564#p44564</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44564#p44564"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44564#p44564"><![CDATA[
<blockquote class="uncited"><div>The result of [rand 20] will allways be a number betwen 0 and 19 (0 and 19 included), while the result of [expr [rand 20] +1] will be from 1 to 20 (1 and 20 included). And if you read again he did said 1 to 20 not 0 to 19. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"></div></blockquote>that's exactly what i meant <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br>however, he didn't say "1 to 20", he said "1 in 20" (chance), so if you take 0-19 or 1-20 doesn't matter <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=2617">arcane</a> — Mon Dec 27, 2004 8:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2004-12-26T15:20:42-04:00</updated>

		<published>2004-12-26T15:20:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44535#p44535</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44535#p44535"/>
		<title type="html"><![CDATA[lol]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44535#p44535"><![CDATA[
Hey guys <br><br>All i needed was a small easy way to make my bot kick someone with a 1 in 20 chance of them triggering the proc kinda a russian roulette thing so 0 - 19 or 1 - 20 would do exactly the same thing at the end of the day thanks again for your replys <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> hope you all had a good xmas.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Sun Dec 26, 2004 3:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-12-26T13:48:09-04:00</updated>

		<published>2004-12-26T13:48:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44530#p44530</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44530#p44530"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44530#p44530"><![CDATA[
&lt;snip&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sun Dec 26, 2004 1:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2004-12-26T13:30:16-04:00</updated>

		<published>2004-12-26T13:30:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44528#p44528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44528#p44528"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44528#p44528"><![CDATA[
Nevermind. You haven't got my "1 to 20" point.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Dec 26, 2004 1:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2004-12-26T12:28:20-04:00</updated>

		<published>2004-12-26T12:28:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44526#p44526</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44526#p44526"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44526#p44526"><![CDATA[
<blockquote class="uncited"><div>The result of [rand 20] will allways be a number betwen 0 and 19 (0 and 19 included), while the result of [expr [rand 20] +1] will be from 1 to 20 (1 and 20 included). And if you read again he did said 1 to 20 not 0 to 19. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"></div></blockquote>0 to 19 are exactly 20 numbers, hence 1 in 20  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sun Dec 26, 2004 12:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2004-12-26T11:10:16-04:00</updated>

		<published>2004-12-26T11:10:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44525#p44525</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44525#p44525"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44525#p44525"><![CDATA[
The result of [rand 20] will allways be a number betwen 0 and 19 (0 and 19 included), while the result of [expr [rand 20] +1] will be from 1 to 20 (1 and 20 included). And if you read again he did said 1 to 20 not 0 to 19. <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=187">caesar</a> — Sun Dec 26, 2004 11:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2004-12-26T08:33:32-04:00</updated>

		<published>2004-12-26T08:33:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44523#p44523</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44523#p44523"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44523#p44523"><![CDATA[
@caesar: that's needed if he wants numbers from 1 to 20. but if he just wants a 1 of 20 chance, demond's solution is fine <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=2617">arcane</a> — Sun Dec 26, 2004 8:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2004-12-25T03:57:22-04:00</updated>

		<published>2004-12-25T03:57:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44493#p44493</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44493#p44493"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44493#p44493"><![CDATA[
[expr [rand 20] +1]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sat Dec 25, 2004 3:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2004-12-24T21:12:00-04:00</updated>

		<published>2004-12-24T21:12:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44481#p44481</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44481#p44481"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44481#p44481"><![CDATA[
<blockquote class="uncited"><div>Code:<br><br>if ![rand 20] {yourproc} </div></blockquote>OMG i am so dumb at times<br><br>thanks demond please dont hesitate to laugh at my stupidity <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=3723">^DooM^</a> — Fri Dec 24, 2004 9:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2004-12-24T21:05:13-04:00</updated>

		<published>2004-12-24T21:05:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44479#p44479</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44479#p44479"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44479#p44479"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if ![rand 20] {yourproc}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Fri Dec 24, 2004 9:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2004-12-24T20:42:40-04:00</updated>

		<published>2004-12-24T20:42:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44477#p44477</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44477#p44477"/>
		<title type="html"><![CDATA[Coding probability]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44477#p44477"><![CDATA[
Hey guys merry xmas.<br><br>Need a hint on how to code probability<br><br>Instead of just using rand to choose wether something is executed or not im looking for a way to give it say a 1 in 20 chance of being executed rather that a 1 in 2 chance. I did a search for probability but came up empty.<br><br>Any help would be greatly appreciated.<br><br>Thanks again.<br><br>Jon.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Fri Dec 24, 2004 8:42 pm</p><hr />
]]></content>
	</entry>
	</feed>
