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

	<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>2006-11-13T02:46:40-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-13T02:46:40-04:00</updated>

		<published>2006-11-13T02:46:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68011#p68011</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68011#p68011"/>
		<title type="html"><![CDATA[Random Number Text]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68011#p68011"><![CDATA[
You could use rand to create the random number, I don't see anything in your script that actually selects any of the numbers from the $number list. <br><br>set number [rand 50]<br><br>(Hmm does rand ever select 0 as a number?  Never checked on that..)<br><br>Then do the tests like:<br><br>if {$text == $number} {#exact match}<br>elseif {$text &lt; $number} {# higher than}<br>elseif {$text &gt; $number} {# greater than}<br>else {# not even in the ballpark}<br><br>I'd also do a <br>if {(![string is integer -strict $text]) || ($text &lt; 0) || ($text &gt; 50)} {<br>     # tell the user the guess has to be a NUMBER between 1 and 50<br>}<br><br>Also, you do not provide any default/fallback error message, so of course it's just doing "return" and not saying anything cos it never matches because "1" is not the same as 1 <br>{$text == "\"1\""} <br>would match IF the user typed <br>guess "1"<br><br>I'd put a default message in there after the else, at least something like <br>puthelp "PRIVMSG $nick :Nope, no number matched.."<br>return<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Mon Nov 13, 2006 2:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kris]]></name></author>
		<updated>2006-11-12T23:58:34-04:00</updated>

		<published>2006-11-12T23:58:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68007#p68007</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68007#p68007"/>
		<title type="html"><![CDATA[Random Number Text]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68007#p68007"><![CDATA[
it sets it, and does most of it but it doesnt reply to the number, any ideas?<br><br>Thanks for your help guys <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br><div class="codebox"><p>Code: </p><pre><code>bind pub "-|-" `numbers msg_number proc msg_number { nick host hand chan text } {putquick "PRIVMSG $chan :\00307\002\037(\037\002\00304$nick has started The Number Guessing Game.\00307\037\002)"putquick "PRIVMSG $chan :\00307\002\037(\037\002\00304The Number Range is From:\002 1 \002To:\002 50 \002\00307\037\002)"putquick "PRIVMSG $chan :\00307\002\037(\037\002\00304To Guess What Number Type: `guess (Number)\002\00307\037\002)"}set number {"\"1\"""\"2\"""\"3\"""\"4\"""\"5\"""\"6\"""\"7\"""\"8\"""\"9\"""\"10\"""\"11\"""\"12\"""\"13\"""\"14\"""\"15\"""\"16\"""\"17\"""\"18\"""\"19\"""\"20\"""\"21\"""\"22\"""\"23\"""\"24\"""\"25\"""\"26\"""\"27\"""\"28\"""\"29\"""\"30\"""\"31\"""\"32\"""\"33\"""\"34\"""\"35\"""\"36\"""\"37\"""\"38\"""\"39\"""\"40\"""\"41\"""\"42\"""\"43\"""\"44\"""\"45\"""\"46\"""\"47\"""\"48\"""\"49\"""\"50\""}bind pub "-|-" `guess msg_guessproc msg_guess { nick chan host handle text number } {if {$number = $text} { putquick "PRIVMSG $chan :Congragulations, $nick, You Have Won!" }if {$number != $text} {if {$number &gt; $text} { putquick "PRIVMSG $chan :This Is Bigger than the correct Number" }if {$number &lt; $text} { putquick "PRIVMSG $chan :This is Smaller than the correct Number" }} else {return}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8180">kris</a> — Sun Nov 12, 2006 11:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
