Vintervalpen Posted March 29, 2012 Report Share Posted March 29, 2012 So. I made this trigger when I was going to stat a new character, because I was uncertain what the new max rolls are for different races and classes. I'm personally using cmud, but it should work on zmud as well. Here goes: #TRIGGER {^Did I get that right: *? ~(Y/N~)} {#VAR autorolling 1;#VAR highestroll 0;#VAR targetroll 99;#VAR rolls 0} Rolling #TRIGGER {^~[(%d)~] Cmds: help, end, roll, add, rem>} {#IF (%1 = @highestroll) {#ADD highrolls 1};#IF (%1 > @highestroll) {#VAR highestroll %1;#VAR highrolls 1};#IF (@autorolling) {#ADD rolls 1};#IF (%1 = @highestroll) {#ADD highrolls 1};#IF (@autorolling) {#SAY You have rolled @rolls amount of times. Your highest roll so far was @highestroll. You have rolled this amount @highrolls times.};#IF (@autorolling) {#IF (%1 < @targetroll) {roll} {#VAR autorolling 0}};#IF (@rolls > 750) {#VAR targetroll @highestroll}} Rolling Basically, the script will roll 750 times (the bolded number), save the highest roll as a variable and then stop rolling when you get that number again. If you want it to be a bit prettier, you can just add the trigger manually rather than just copy/pasting the #TRIGGERs into your command output. Pattern: ^Did I get that right: *? ~(Y/N~) Script text: #VAR autorolling 1 #VAR highestroll 0 #VAR targetroll 99 #VAR rolls 0 Pattern: ^~[(%d)~] Cmds: help, end, roll, add, rem> Script text: #IF (%1 = @highestroll) {#ADD highrolls 1} #IF (%1 > @highestroll) {#VAR highestroll %1;#VAR highrolls 1} #IF (@autorolling) {#ADD rolls 1} #IF (%1 = @highestroll) {#ADD highrolls 1} #IF (@autorolling) {#SAY You have rolled @rolls amount of times. Your highest roll so far was @highestroll. You have rolled this amount @highrolls times.} #IF (@autorolling) {#IF (%1 < @targetroll) {roll} {#VAR autorolling 0}} #IF (@rolls > 750) {#VAR targetroll @highestroll} So what does this all mean? 1. The script resets all variables when matching the first trigger (such as setting a name, race, or class for your new character). 2. The script rolls 750 times and remembers your highest roll. 3. The next time it rolls that number (the highest of the 750), it will stop rolling. 4. It will automatically stop rolling after you get the desired roll, meaning you don't have to disable any triggers or anything before allocating your stats. Essentially, you don't have to care about the max rolls for any specific race/class combination. 750 might be too low to get the highest potential roll for some combinations, but it's worked out pretty good for the ones I tested. The script will also save some variables for you when it is rolling, which can be sort of useful. It echoes them every time you get a new roll, like this: Rolling stats for drow dark-knight.: Max: Str: 18 Int: 24 Wis: 20 Dex: 24 Con: 16 Cur: Str: 14 Int: 14 Wis: 14 Dex: 14 Con: 14 [18] Cmds: help, end, roll, add, rem> You have rolled 920 amount of times. Your highest roll so far was 23. You have rolled this amount 2 times. If you want to change the number of times to roll, simply increase or decrease the number 750 in the second trigger. Link to comment Share on other sites More sharing options...
Filth Posted April 5, 2012 Report Share Posted April 5, 2012 Bravo, this is a good one. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.