Dice Rolling

Submitted by CyberKing on Tue, 2010-04-27 16:34

I have created the command +roll, which simulates rolling a dice by using the rand() function. I know it works because when I change think for say I get the result. however I want to be able to use this in other commands so just saying the number won't do much good. I need the command to work from within another command.
I have attacked some code snippets below. these are, of corse, what I belive to be correct. It may be that I am takeing a completely wrong approach to this.

just roll and 'return' the result
ROLLADICE [#5]: $+roll *:think rand(1,%0)

roll then say result, this calls the above command:
MANROLL [#5]: $+dice *:say [+roll %0]

I thought I would just be able to 'say +roll 6' but I can't