I figured out how to macro a simple universal dice roller that works for 3.5e which I scripted it for. Basically I broke down 1d20 + 0 vs. DC of 0 into an expression resembling this---> (Z)d(Y) + (X) vs. DC of (W)
you press the macro and your prompted for 4 variables in order:
Z is the number of dice your using
Y is the number of sides to your dice
X is the modifier for the roll
W is the Dm determined DC that the roll checks for. Not important right yet.
So what happens is your asked for the numbers to the expression. When that is
finished the macro evaluates the expression
?d? + ? just as simply as typing
1d4 + 2 into the chat box for maptools.
Now for the variable that I named W, I used this as a basis to check if the roll succeeds or not. Basically if the roll succeeds against the DC you get a success message, failure for failure.
This macro works for 3.5e rules because maptool itself has the internal roller that is triggered by typing in the syntax for it.
So I thought to myself, okay. I got the dice covered, now to make a different macro with the same script in the command box so the DM can make the roll secretly if needed, for spot and listen checks and vice versa. Truly all ive never need was players, dice, paper, pen to run a campaign. With maptools you got the paper and pen covered. I just needed a dice script. Thanks for your time.
Again since I made such a complex post out of something that produced a simple result, ill give you the finished result and let you test it out.
First make a macro, then edit it. For name put in something like test roller, for Command enter the code.
Code: Select all
is rolling {RollNumber = How_Many_Die}d{DiceType=How_Many_Die_Sides} + {Modifier = How_Many_Modifiers} vs. DC {DiffClass = Difficulty_Class} and he gets a total of {FinalRoll=(eval ( Rollnumber + "d" + DiceType ) + Modifier)}<BR>{if (FinalRoll>=DiffClass,("Success, I rolled a " + FinalRoll + " vs. a DC of " + DiffClass + "."),("Failure, I rolled an " + FinalRoll + " vs. a DC of " + DiffClass + "."))}
I could break it down, but you can really understand this better if you break it down into sections by yourself. Also, I have altered my frame of mind and completely forgot how I came about this solution.
Now I made a second macro, entered the same code as before in the command box. Added a /self to the beginning of the script and changed some of the text around. Poof a secret roller.