Description / Important Notes:

This is my overly elaborate reroll script. It's a bit out of the ordinary in that I set it up to do maximum values as well as minimum ones, mostly because I just don't like high charisma. For the most part the maximum values can just be ignored. It also uses a variable you'll have to set up manually called @touch which determines whether or not the trigger should touch the orb and save the final roll or wait until you decide to do it. Generally if I'm at work or asleep or something then I'll set @touch to 1 but otherwise leave it off. If you're going to have touch set to 0 then you'll need to also set up a tick timer so you don't go into the void (which will disconnect you) and it would need to be two (silent!) commands so you don't hit the 20 spam limit, I use look;score. There's no trigger for when your name is authed, because you're automatically rerolled anymore when that happens. The actual trigger fires on the line that returns from the 'gold' command as it simplifies the trigger a bit and removes the script a ways from the command itself.

This revision of this trigger set is smaller than the last one, but I've left it in a text file for simplicity. You can either copy and paste it straight into your nd follow what follows. These triggers should already appear in separate class called 'reroll' but you may wish to use a whole different char file to keep things organised (personally, I just disable the class). Either just paste everything out of the text file into zMUD's command prompt or save the text file to your hard drive and import it into zMUD (To do this, open your triggers window, click on the file menu and select Import text. Direct it to the text file you downloaded and it will load all the triggers straight into your char file).

Instructions / Explanation:

Just in case you want to understand how the trigger works, here's a rundown (or if you just want to know how to use it, ignore the grey bits).

Make your character (pick class/race etc, down to the motd and 'help start'). The process then begins by pressing the Setup button. This resets the variable for counting the number of rolls and enters the values of each of the min/max variables using the prompt function (%prompt). It's pretty simple if you don't mess up the syntax (like the countless times I forget that last bracket). This will open a small window on top of zmud saying "Enter MINIMUM acceptable STRENGTH", with a default value of 9 already entered. If you don't care and just want 9, you can press enter. This is more useful for the maximum values, which I imagine most people won't really use.

strMin=%prompt(9,"Enter MINIMUM acceptable STRENGTH")

Once that's done, press the start button. This will move your new character quickly through the newbie area and reroll once but not start off the trigger. I'm not sure why I made it do that really, but it will load all the right variables up so that when you are actually authed you can check that roll and begin rolling. Also, to be clear, you should never type "reroll" or "gold". They'll both screw up the trigger set and will you double reroll forever and it will go past even a successful roll.

The main reason this trigger set is so big is that I like to be able to watch it reroll. For each stat there's a check to see not only whether it passed, but whether it was too high or too low. I used to do this with the lovely square brackets that zMUD used for quick calculations, but they seem to have retired them completely in 7.x, so I've rewritten them with big nested ifs like this one. The trigger checks to see whether the roll for this stat is too high or too low, works out the difference between the stat and the required stat, then reports it. If it's neither too high or too low, it announces a pass.

#IF (@str < @strMin) {#math strDif @strMin-@str;#say %ansi( 12) STR check FAILED, by %ansi( 15)-@strDif %ansi( 12)point(s)!} {#IF (@str > @strMax) {#math strDif @str-@strMax;#say %ansi( 12) STR check FAILED, by %ansi( 15)+@strDif %ansi( 12)point(s)!} {#say %ansi( 10) STR check PASSED!}}

The last check is a big ugly one, but it's the most important. It's just a big ifcheck to see if the values for the current roll are within the desirable range. If they are, it then checks further to see if the 'touch' variable is set to 1 (true). If this is so, it touches the orb and saves. If the roll isn't good enough, then it says so and keeps rolling.

#IF (@str >= @strMin)AND(@str <= @strMax)AND(@dex >= @dexMin)AND(@dex <= @dexMax)AND(@int >= @intMin)AND(@int <= @intMax)AND(@wis >= @wisMin)AND(@wis <= @wisMax)AND(@cha >= @chaMin)AND(@cha <= @chaMax)AND(@con >= @conMin)AND(@con <= @conMax)AND(@lck >= @lckMin)AND(@lck <= @lckMax) {#beep;#echo REROLL MATCHES DESIRED STATS!;#SA Reroll complete.;#SA It took @rollCounter to get these stats.;#IF (@touch = 1) {touch orb;save}} {#say Stat roll is undesirable.;#say Rerolling..;reroll;gold}}