Originally Posted By: Feyl0rd
Here's the finished product if anyone was interested. With Nillens help and a bit of help from the help files:
Code:
on *:text:!d*:#:{
  var %h = $right($1,-2)
  if %h < 0 { msg $chan $nick %h is not a valid entry. }
  if %h isletter { msg $chan $nick %h is not a valid entry. }
  else { msg $chan $nick rolled a ( $r(1,%h) ). }
}

Thank you Nillen!
Hope this helps anyone who needs it.


The code by itself is working as intended;

However...

If you type !d<and anything else here>, it returns with <and anything else here> is not a valid entry.

Meaning.. if you have any other command that starts with !d, the !d command will also post.

Therefore; the trigger event !d needs to be changed. But, if you change !d to anything else.. say "!dice".. then the entire code doesn't work.

Any idea how to change it? what causes the problem?

I would love the dice roll trigger event to be !dice*, but it doesn't work the current way it is written.