Wonderd if it was harder in autoit.
and it was SOOO easy.
but i still decided to post it
Func _DiceRoll($i_Dices = 1, $i_Sides = 6) ;check for valid numbers If Not IsInt($i_Dices) Or Not IsInt($i_Sides) Or Round($i_Dices) <> $i_Dices Or Round($i_Sides) <> $i_Sides Then SetError(1) Return 0 EndIf ;filter out technical impossibilitys If $i_Dices <= 0 Or $i_Sides <= 3 Then SetError(2) Return 0 EndIf ;add the buffer Local $i_rnd = 0 ;roll the dices and add em to the buffer For $i_count = 1 To $i_Dices $i_rnd += Random(1, $i_Sides, 1) Next ;return the buffer Return $i_rnd EndFunc;==>_DiceRoll
Edited by w0uter, 30 May 2005 - 08:57 PM.





