Hello all!
I want to use the below dice rolling script for a game I'll soon GM. Unfortunately, it's not running, and I have next to no experience at coding (I found it off a Google search). I'm just an RPG enthusiast who enjoys running games over IRC and wants use scripts as a time-saving alternative to rolling physical dice. They might as well be written in Greek to me.
on *:text:roll &:#: {
if ($2 !isnum) { msg $chan Invalid number of dice. | return }
var %c = $2
while (%c) {
var %roll = $rand(1,10)
if (%roll = 1) { var %roll = #04,01 $+ %roll }
elseif (%roll isnum 2-7) { var %roll = #00,01 $+ %roll }
elseif (%roll isnum 8-9) { var %roll = #03,01 $+ %roll }
else { var %roll = #09,01 $+ %roll }
var %dice = %dice $+ $iif(%dice,# $+ $chr(44)) %roll
dec %c
}
describe $chan $nick rolls $2 dice: $replace(%dice,$chr(46),# $+ $chr(44) $+ $chr(32))
}
I don't think there's anything wrong with the script itself, as it worked for other posters in the
thread I found it from. When I type 'roll 2' or 'roll 4', though, nothing happens. I just get the text I enter displayed as a message, no dice rolled. I've been able to successfully run another (less convenient) dice rolling script, so at least this one isn't working because IRC categorically hates my guts.
Hopefully the answer to my problem will turn out to be something totally simple. Thank you very much for any help!