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

	<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-07-08T12:13:51-04:00</updated>

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

		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-08T12:13:51-04:00</updated>

		<published>2004-07-08T12:13:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38353#p38353</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38353#p38353"/>
		<title type="html"><![CDATA[using chances when setting variables with random]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38353#p38353"><![CDATA[
I didn't clearly understand what you are trying to say and what your question was. Please state it clearly, what do you want the script to do (PURPOSE/OUTPUT)?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Thu Jul 08, 2004 12:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-07-08T09:49:56-04:00</updated>

		<published>2004-07-08T09:49:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38346#p38346</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38346#p38346"/>
		<title type="html"><![CDATA[using chances when setting variables with random]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38346#p38346"><![CDATA[
A while ago a made a tcl script that does this:<br>1. pick a random number<br>2. assign a certain value to a variable according to the number<br><br>This is what I came up with:<div class="codebox"><p>Code: </p><pre><code>set foo [random 9] if {$foo &gt;= 0 &amp;&amp; $foo &lt;= 2} { set bar "something" }  if {$foo &gt;= 3 &amp;&amp; $foo &lt;= 6} { set bar "something else" }  if {$foo &gt;= 7 &amp;&amp; $foo &lt;= 9} { set bar "something completely different" }</code></pre></div>Now I know this is propably the worst way of doing this sort of thing, but it worked all right. Until now when I would need to change the chances of the values easily with variables. Lets say I want to change the chances of the first one to 0-4. If I just do that without altering the rest of the script it will completely mess it up.<br>I have thought about alternative ways but since I'm quite new to tcl it just makes my head hurt  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>I also searched the forums but couldn't find anything helpful.<br>Any help will be appreciated.<br><br>[EDIT: typos and stuff]<p>Statistics: Posted by Guest — Thu Jul 08, 2004 9:49 am</p><hr />
]]></content>
	</entry>
	</feed>
