Ok. I'm currently playing a WoT based mud that lets you "roll" for stats. I made me a trigger/variable/script combo to help me get the perfect stats.... I have a small problem in it, however, that makes my trigger useless.
Here is the problem: The trigger and script will happily reroll the stats till it finds the ones I want. When it does find it, the script does stop. However, I find that it stops one revolution too late: in other words, it stops right after it sends an extra "n" to the mud.
Here is the trigger/variable/script info:
Stat Triggers:
Prompt trigger:
Here is the problem: The trigger and script will happily reroll the stats till it finds the ones I want. When it does find it, the script does stop. However, I find that it stops one revolution too late: in other words, it stops right after it sends an extra "n" to the mud.
Here is the trigger/variable/script info:
Stat Triggers:
- Label: trgStatCon/trgStatInt/trgStatWis (to match the purpose of each stat trigger)
- Trigger text: constitution/intelligence/wisdom : %1
- Action: Sends the %1 value of each trigger to its corresponding variable: varStatCon, varStatInt and varStatWis
- Sequence: 90 for all three triggers.
Prompt trigger:
- Label: trgStatCheck
- Trigger text: Do you wish keep these stats? *
- Action: call script ScriptStatCheck
- Sequence: 100 (hopefully forcing this trigger to let the others fire first)
Script Code:
Sub ScriptStatCheck (trgStatCheck, theoutput, Wildcards) dim iCon, iInt, iWis 'Assign each script variable the value of its matching mud variable iCon = World.GetVariable ("varStatCon") iInt = World.GetVariable ("varStatInt") iWis = World.GetVariable ("varStatWis") 'evaluate rolled stats if iCon >= 20 and iInt >= 20 and iWis >= 20 then World.Sound "sound.wav" exit sub else World.DoAfter 1, "n" 'Tell the mud these stats aren't wanted, reroll again. 'After "n" is sent to the world, the mud again rolls stats, displays the 'new stats, and, of course, the prompt line again. 'So the trigger fires again, and continues to do so until the if condition is true. end if end sub
Anything I'm doing wrong? The script/trigger always fires one extra command that ruins the effectiveness of the pair. Sorry if my code isn't the best.