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

	<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>2017-05-16T13:10:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2017-05-16T13:10:03-04:00</updated>

		<published>2017-05-16T13:10:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106273#p106273</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106273#p106273"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106273#p106273"><![CDATA[
<blockquote class="uncited"><div>...<br>This means that if we run the two commands 1000 times then the results lsearch will be roughly 3.3 times faster. Good job willy! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>...</div></blockquote>No credit deserved.    <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>This is where I admit that if that is true, then it was just dumb luck on my part... because I don't like using while loops, because I always screw them up, and have to go re-read a few times, to un-screw them.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Tue May 16, 2017 1:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2017-05-16T12:12:31-04:00</updated>

		<published>2017-05-16T12:12:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106272#p106272</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106272#p106272"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106272#p106272"><![CDATA[
You should replace:<div class="codebox"><p>Code: </p><pre><code>if {$nick != "Jason"} { </code></pre></div>with:<div class="codebox"><p>Code: </p><pre><code>if {![string equal -nocase $nick "Jason"]} {</code></pre></div>to make it be case insensitive, meaning jason isn't equal with Jason or JASON for example.<br><br>Don't know why I didn't think about <em class="text-italics">lsearch -all -inline</em> in the first place cos is by far a better solution than the while loop I opted for.<div class="codebox"><p>Code: </p><pre><code>% time {llength [lsearch -all -inline $dices 9]} 10001.167 microseconds per iteration% time {count $dices 9} 10003.851 microseconds per iteration</code></pre></div>This means that if we run the two commands 1000 times then the results lsearch will be roughly 3.3 times faster. Good job willy! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>With this info in mind i would consider dumping my old count function in favor of:<div class="codebox"><p>Code: </p><pre><code>proc count {haystack needle} {set count [llength [lsearch -all -inline $haystack $needle]]}</code></pre></div>then remove the:<div class="codebox"><p>Code: </p><pre><code>      set num10s  [ llength [lsearch -all -inline $dices 10 ] ]      set num9s  [ llength [lsearch -all -inline $dices 9 ] ] </code></pre></div>and use $count(10) instead of $num10s and $count(9) instead of $num9s.<br><br>You can also drop the rand function cos I left it there because tclsh doesn't have the rand function and had to create it when was testing the code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue May 16, 2017 12:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Steamwolf]]></name></author>
		<updated>2017-05-16T08:55:51-04:00</updated>

		<published>2017-05-16T08:55:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106271#p106271</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106271#p106271"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106271#p106271"><![CDATA[
We did spend a bit of time on it in the beginning before we started working on the resources database project, though the edits were pretty minor.<br><br>Here's the final code <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"> Thanks again for all the help guys!<br><div class="codebox"><p>Code: </p><pre><code>namespace eval cofdroll {    bind pub * !roll [namespace current]::pubRoll        proc pubRoll {nick uhost hand chan text} {       ###scan $text {%s%s} pool explanation      set pool [lindex [split $text] 0 ]      # set reroll [lindex [split $text] 1 ]      set explanation [lrange [split $text] 1 end ]      # use the following lines only for testing, then just comment them out when they irritate you      # putserv "privmsg $chan :pool is: $pool   -  reroll is: $reroll "      # putserv "privmsg $chan :explanation is: $explanation"      # putserv "privmsg $chan : "      if {![llength [split $text] ] } {         putserv "privmsg $chan :Sorry, but you need to tell me how many dice to roll! The correct syntax is !roll #pool explanation."         return      }       if {![string is integer $pool]} {          puthelp "PRIVMSG $chan :Sorry, but you need to tell me how many dice to roll! The correct syntax is !roll #pool explanation."          return       }       # if {![string is integer $reroll]} {       #    puthelp "PRIVMSG $chan :Sorry, but you need to tell me on what number to reroll. 10? 9? 8? The correct syntax is !roll #pool explanation."       #    return       # }       if {![string length $explanation]} {          puthelp "PRIVMSG $chan :Sorry, but you need to tell me what you're trying to do. The correct syntax is !roll #pool explanation."          return       }       if {$pool &gt; 50} {      if {$nick != "Jason"} {         putserv "kick $chan $nick :BAHAhaHAhaHahAH!! You're so funny!"         putserv "invite $chan $nick"         return      }      }      for {set x 0} {$x &lt; $pool} {incr x} {          lappend dices [expr [rand 10]]       }       set numbers "10 9 8"       foreach no [split $numbers] {          set count($no) [count $dices $no]       }       foreach {index value} [array get count] { incr sucs $value }       switch -- $explanation { 8 { set c $sucs } 9 { set c [expr $count(10) + $count(9)] } default { set c $count(10) } }       # puthelp "PRIVMSG $chan :$nick -( $sucs )- [join $dices ", "]"       # putserv "privmsg $chan :dices is: $dices"      set num10s  [ llength [lsearch -all -inline $dices 10 ] ]      set num9s  [ llength [lsearch -all -inline $dices 9 ] ]      set numfails [expr $pool - $sucs]      # putserv "privmsg $chan :10s is: $num10s"      # putserv "privmsg $chan :9s is: $num9s"      # putserv "privmsg $chan :failures is: $numfails"      putserv "PRIVMSG $chan :=$nick= Rolled $sucs Success(es) for \"$explanation\" - Tens: $num10s, Nines: $num9s, Failures: $numfails ( $dices )"      # if {$sucs &gt; 4} {       #    puthelp "PRIVMSG $chan :$nick :: EXCEPTIONAL SUCCESS!!"       # }    }    proc rand {max} {       return [expr {int(rand()*$max) + 1}]    }    proc count {haystack needle} {       set c [set pos 0]          while {[set pos [expr {[string first $needle $haystack $pos] + 1}]]} {             incr c          }       return $c    } } </code></pre></div>I added the kick commentary myself <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";-)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12694">Steamwolf</a> — Tue May 16, 2017 8:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2017-05-16T08:53:18-04:00</updated>

		<published>2017-05-16T08:53:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106270#p106270</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106270#p106270"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106270#p106270"><![CDATA[
<blockquote class="uncited"><div>Ah! Ok. No problem, glad you guys sorted it out. Would be great if could share what you altered just for the sake of understanding where i did wrong. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>caesar:<br>I think what happened is that Steamwolf decided it was ok as-is.    Because I barely remember discussing it with him...  I haven't even spent enough time on it to really try to understand what is going on with it.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>What I did with him was some sort of score keeping thing.  Let's him read/write to a text file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Tue May 16, 2017 8:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2017-05-16T00:46:44-04:00</updated>

		<published>2017-05-16T00:46:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106265#p106265</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106265#p106265"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106265#p106265"><![CDATA[
Ah! Ok. No problem, glad you guys sorted it out. Would be great if could share what you altered just for the sake of understanding where i did wrong. <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=187">caesar</a> — Tue May 16, 2017 12:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Steamwolf]]></name></author>
		<updated>2017-05-15T13:02:35-04:00</updated>

		<published>2017-05-15T13:02:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106261#p106261</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106261#p106261"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106261#p106261"><![CDATA[
omg I'm so sorry, I thought I replied to this!<br><br>willyw PM'd me, and together we managed to work everything out. I was reminded by a friend that sometimes players are denied re-rolls, so we just went with a single-roll system.<br><br>Thanks for the script! With our minor tweaking, it was exactly what I needed!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12694">Steamwolf</a> — Mon May 15, 2017 1:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2017-05-12T04:46:38-04:00</updated>

		<published>2017-05-12T04:46:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106255#p106255</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106255#p106255"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106255#p106255"><![CDATA[
Right so !roll 20 10 whatever will pick 20 random numbers from 1 to 10, let's say 2, 9, 8, 2, 7, 1, 9, 2, 2, 6, 10, 7, 10, 2, 4, 1, 4, 7, 6, 5 and then what?<br><br>If you loaded the code as it is then the bot should respond. You see any errors in DCC Chat/Telnet with it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri May 12, 2017 4:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Steamwolf]]></name></author>
		<updated>2017-05-09T21:34:47-04:00</updated>

		<published>2017-05-09T21:34:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106254#p106254</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106254#p106254"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106254#p106254"><![CDATA[
I must be doing something wrong... I loaded the script, rehashed, and typed !roll 10 10 test<br><br>and nothing happened...<br><br>But then I came to realize, it seems that my eggdrop bot isn't responding to triggers from text on public channels at <strong class="text-strong">all</strong>... is there some setting I didn't realize I needed to turn on or something?<br><br><br><br><br><br>Here's an example using my current mIRC bot...<br><br>&lt;~Jason&gt; !roll 20 10 This is a test where I roll 20 ten sided dice and reroll any that come up tens<br>&lt;+Paradigm&gt; Jason -( 5 )- 2, 9, 8, 2, 7, 1, 9, 2, 2, 6, 10, 7, 10, 2, 4, 1, 4, 7, 6, 5<br>&lt;+Paradigm&gt; Jason -( 1 )- 3, 8<br>&lt;+Paradigm&gt; Jason :: Grand Total Successes: 6 ( This is a test where I roll 20 ten sided dice and reroll any that come up tens )<br>&lt;+Paradigm&gt; Jason :: EXCEPTIONAL SUCCESS!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12694">Steamwolf</a> — Tue May 09, 2017 9:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2017-05-09T12:12:46-04:00</updated>

		<published>2017-05-09T12:12:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106253#p106253</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106253#p106253"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106253#p106253"><![CDATA[
Don't know how mrc treats the jump to :reroll for instance so need to test that code and say if it dose as should or not and will take it from there with the rest.<br><br>Would be great if you could give me an example cos honestly don't know what #1, #2 or explanation are meant to be.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue May 09, 2017 12:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Steamwolf]]></name></author>
		<updated>2017-05-09T06:51:18-04:00</updated>

		<published>2017-05-09T06:51:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106252#p106252</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106252#p106252"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106252#p106252"><![CDATA[
Whoops! I just realized I had the word redraw in there instead of reroll. lol, my bad.<br><br>Thanks for the script! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"> I'll be able to test it in a few hours on my lunch break.<br><br>Basically, the first script responds to a command of "!roll #1 #2 explanation" by generating #1 random numbers from one to ten, counting any that come up as &gt;= 8 as "successes" and then continuing to generate random numbers from one to ten for any that came up &gt;= #2 until there are no more numbers &gt;= #2 to reroll. It then tallies up all the successes and responds with that number. If the successes &gt;= 5, it says "Exceptional Success"<br><br>The check for &gt;100 is to check the pool, rather than the reroll number. if someone tries to roll more than 100 dice, the script should balk at them.<br><br>--<br><br>The second script does exactly the same thing, except it uses !rote instead of !roll, and on the first roll (before any rerolls), all "failures" ( dice that came up less than 8 ) are rerolled. After which, rerolls continue normally.<br><br>--<br><br>The last script responds to !chance by rolling a single die (random number one to ten) and seeing if the result is a ten. If it is, it adds one to the success tally and continues rerolling until the result is no longer ten. If the first roll is a one, it returns "Dramatic Failure"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12694">Steamwolf</a> — Tue May 09, 2017 6:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2017-05-09T03:24:49-04:00</updated>

		<published>2017-05-09T03:24:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106251#p106251</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106251#p106251"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106251#p106251"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>namespace eval diceGames {bind pub * !roll [namespace current]::pubRollproc pubRoll {nick uhost hand chan text} {scan $text {%s%s%s} pool redraw explanationif {![string is integer $pool]} {puthelp "PRIVMSG $chan :Sorry, but you need to tell me how many dice to roll! The correct syntax is !roll #pool #redraw explanation."return}if {![string is integer $redraw]} {puthelp "Sorry, but you need to tell me on what number to redraw. 10? 9? 8? The correct syntax is !roll #pool #redraw explanation."return}if {![string length $explanation]} {puthelp "PRIVMSG $chan :Sorry, but you need to tell me what you're trying to do. The correct syntax is !roll #pool #redraw explanation."return}if {$redraw &gt; 100} {puthelp "PRIVMSG $chan :No way, That's too many dice!"return}for {set x 0} {$x &lt; $count} {incr x} {lappend dices [expr [rand 10] + 1]}set numbers "10 9 8"foreach no [split $numbers] {set count($no) [count $dices $no]}foreach {index value} [array get count] { incr sucs $value }switch -- $explanation { 8 { set c $sucs } 9 { set c [expr $count(10) + $count(9)] } default { set c $count(10) } }puthelp "PRIVMSG $chan :$nick -( $sucs )- [join $dices ", "]"puthelp "PRIVMSG $chan :$nick :: Grand Total Successes: $sucs ( $explanation )if ($sucs &gt; 4) {puthelp "PRIVMSG $chan :$nick :: EXCEPTIONAL SUCCESS!!"}}proc rand {max} {return [expr {int(rand()*$max) + 1}]}proc count {haystack needle} {set c [set pos 0]while {[set pos [expr {[string first $needle $haystack $pos] + 1}]]} {incr c}return $c}}</code></pre></div>I'm not 100% sure I fully understood the code so give this a try and let me know if works and the result is as expected.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue May 09, 2017 3:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Steamwolf]]></name></author>
		<updated>2017-05-09T07:12:13-04:00</updated>

		<published>2017-05-08T17:43:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106249#p106249</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106249#p106249"/>
		<title type="html"><![CDATA[CofD Dice Script: mcr to tcl conversion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106249#p106249"><![CDATA[
Hello! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"><br><br>Please bear with my incredible lack of experience. I've tried searching for an answer to this, and I've tried muscling through tutorials on tcl, but I have a long way to go before I even begin to understand what I'm doing.<br><br>I've recently started up my very first private irc server to run a game (Chronicles of Darkness) with some friends, which is great fun and a total adventure in learning technical things I've never thought I'd be able to do. That said, I have a few dice scripts coded in mIRC that I would very much like to port over to my Eggdrop bot, but I simply don't have the experience with tcl required to do so.<br><br>If anyone could possibly help me out, I'd be most appreciative.<br><br>Here's the code for my three current scripts in mIRC...<br><div class="codebox"><p>Code: </p><pre><code>on *:text:!roll*:#: {  if ($2 !isnum) { msg # (( Sorry, but you need to tell me how many dice to roll! The correct syntax is !draw #pool #reroll explanation. )) | return }  if ($3 !isnum) { msg # (( Sorry, but you need to tell me on what number to reroll. 10? 9? 8? The correct syntax is !draw #pool #reroll explanation. )) | return }  if ($4 == $null) { msg # (( Sorry, but you need to tell me what you're trying to do. The correct syntax is !draw #pool #reroll explanation. )) | return }  var %totsucs = 0  var %c = $2  if (%c &gt; 100) {    msg # No way, That's too many dice!    halt  }  :reroll  var %dice = %blank  var %rers = %blank  var %s10s = %blank  var %s9s = %blank  var %s8s = %blank  var %sucs = %blank  while (%c &gt; 0) {     var %roll = $rand(1,10)     if (%roll = 1) { var %roll = $+ %roll }     elseif (%roll isnum 2-7) { var %roll = $+ %roll }     elseif (%roll isnum 8-9) { var %roll = $+ %roll }     else { var %roll = $+ %roll }     var %dice = %dice $+ $iif(%dice, $+ $chr(44)) %roll     dec %c  }  var %s10 = 10  var %s9 = 9  var %s8 = 8  var %s10s = $count(%dice,%s10)  var %s9s = $count(%dice,%s9)  var %s8s = $count(%dice,%s8)  var %sucs = $calc(%s10s + %s9s + %s8s)  var %8rr = $calc(%s10s + %s9s + %s8s)  var %9rr = $calc(%s10s + %s9s)  var %10rr = $count(%dice,%s10)  if ($3 = 8) { var %c = %8rr }  elseif ($3 = 9) { var %c = %9rr }  else { var %c = %10rr }  msg # $nick -( %sucs )- $replace(%dice,$chr(46), $+ $chr(44) $+ $chr(32))  var %temp = %sucs  var %runtot = $calc(%runtot + %sucs)  var %sucs = %blank  var %temp = %blank  if (%c &gt; 0) {  goto reroll }  msg # $nick :: Grand Total Successes: %runtot ( $4- )  if (%runtot &gt; 4) { msg # $nick :: EXCEPTIONAL SUCCESS!! }}</code></pre></div><div class="codebox"><p>Code: </p><pre><code>on *:text:!rote*:#: {  if ($2 !isnum) { msg # (( Sorry, but you need to tell me how many dice to roll! The correct syntax is !draw #pool #reroll explanation. )) | return }  if ($3 !isnum) { msg # (( Sorry, but you need to tell me on what number to reroll. 10? 9? 8? The correct syntax is !draw #pool #reroll explanation. )) | return }  if ($4 == $null) { msg # (( Sorry, but you need to tell me what you're trying to do. The correct syntax is !draw #pool #reroll explanation. )) | return }  var %totsucs = 0  var %c = $2  var %rote = 0  if (%c &gt; 100) {    msg # No way, That's too many dice!    halt  }  :rotereroll  while (%c &gt; 0) {     var %roll = $rand(1,10)     if (%roll = 1) { var %roll = $+ %roll }     elseif (%roll isnum 2-7) { var %roll = $+ %roll }     elseif (%roll isnum 8-9) { var %roll = $+ %roll }     else { var %roll = $+ %roll }     var %dice = %dice $+ $iif(%dice, $+ $chr(44)) %roll     dec %c  }  var %s10 = 10  var %s9 = 9  var %s8 = 8  var %s10s = $count(%dice,%s10)  var %s9s = $count(%dice,%s9)  var %s8s = $count(%dice,%s8)  var %sucs = $calc(%s10s + %s9s + %s8s)  msg # $nick -( %sucs )- $replace(%dice,$chr(46), $+ $chr(44) $+ $chr(32))  var %c = $calc($2 - %sucs)  inc %rote  var %temp = %sucs  var %runtot = $calc(%runtot + %sucs)  var %sucs = %blank  var %temp = %blank  var %dice = %blank  var %rers = %blank  var %s10s = %blank  var %s9s = %blank  var %s8s = %blank  var %sucs = %blank  if (%rote &lt; 2) { goto rotereroll }  else { var %c = %runtot }  :reroll  var %dice = %blank  var %rers = %blank  var %s10s = %blank  var %s9s = %blank  var %s8s = %blank  var %sucs = %blank  while (%c &gt; 0) {     var %roll = $rand(1,10)     if (%roll = 1) { var %roll = $+ %roll }     elseif (%roll isnum 2-7) { var %roll = $+ %roll }     elseif (%roll isnum 8-9) { var %roll = $+ %roll }     else { var %roll = $+ %roll }     var %dice = %dice $+ $iif(%dice, $+ $chr(44)) %roll     dec %c  }  var %s10 = 10  var %s9 = 9  var %s8 = 8  var %s10s = $count(%dice,%s10)  var %s9s = $count(%dice,%s9)  var %s8s = $count(%dice,%s8)  var %sucs = $calc(%s10s + %s9s + %s8s)  var %8rr = $calc(%s10s + %s9s + %s8s)  var %9rr = $calc(%s10s + %s9s)  var %10rr = $count(%dice,%s10)  if ($3 = 8) { var %c = %8rr }  elseif ($3 = 9) { var %c = %9rr }  else { var %c = %10rr }  msg # $nick -( %sucs )- $replace(%dice,$chr(46), $+ $chr(44) $+ $chr(32))  var %temp = %sucs  var %runtot = $calc(%runtot + %sucs)  var %sucs = %blank  var %temp = %blank  if (%c &gt; 0) {  goto reroll }  msg # $nick :: Grand Total Successes: %runtot ( $4- )  if (%runtot &gt; 4) { msg # $nick :: EXCEPTIONAL SUCCESS!! }}</code></pre></div><div class="codebox"><p>Code: </p><pre><code>on *:text:!chance*:#: {  if ($2 == $null) { msg # (( Sorry, but you need to tell me what you're trying to do. The correct syntax is !chance explanation. )) | return }  var %totsucs = 0  var %totsucs = 0  var %c = 1  :reroll  var %dice = %blank  var %rers = %blank  var %s10s = 0  var %s9s = %blank  var %s8s = %blank  var %s1s = %blank  var %sucs = %blank  while (%c &gt; 0) {     var %roll = $rand(1,10)     if (%roll = 1) { var %roll = $+ %roll }     elseif (%roll isnum 2-7) { var %roll = $+ %roll }     elseif (%roll isnum 8-9) { var %roll = $+ %roll }     else { var %roll = $+ %roll }     var %dice = %dice $+ $iif(%dice, $+ $chr(44)) %roll     dec %c  }  var %s10 = 10  var %s1 = 1  var %s10s = $count(%dice,%s10)  var %s1s = $count(%dice,%s1)  var %sucs = %s10s  var %botch = %s1s  var %10rr = $count(%dice,%s10)  var %c = %10rr  msg # $nick -( %sucs )- $replace(%dice,$chr(46), $+ $chr(44) $+ $chr(32))  if (%s1s &gt; 0) { if (%s10s = 0) { msg # $nick -( !! DRAMATIC FAILURE !! )- } }  var %temp = %sucs  var %runtot = $calc(%runtot + %sucs)  var %sucs = %blank  var %temp = %blank  if (%c &gt; 0) {  goto reroll }  msg # $nick :: Grand Total Successes: %runtot ( $2- )  if (%runtot &gt; 4) { msg # $nick :: EXCEPTIONAL SUCCESS!! }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12694">Steamwolf</a> — Mon May 08, 2017 5:43 pm</p><hr />
]]></content>
	</entry>
	</feed>
