I need some help here. I have an Applescript that's supposed to be a dice-roller - it can roll any number of dice of any side, and report the total. The only problem is, I can't get the random number to be an integer. Here is the script:
tell application "ircle 3.1 Am. English PPC"
set obj to argstring
set thenumber to 0
if obj = "" then
set r to display dialog "Number of dice?" default answer "1"
set obj to (text returned of r)
set t to display dialog "Number of sides?" default answer "6"
set obj2 to (text returned of t)
set ch to currenttarget
set ecks to 0
repeat obj times
set roll to (random number from 1 to obj2)
set ecks2 to ecks + roll
do "/me rolls " & obj & "d" & obj2 & " and gets " & ecks2 & "!"
The dialog box does not return an integer, which is why I think it's not working right. The results I get from rolling the default 1d6 come out to a 12 place decimal. -_-;
Anyone have any suggestions?