After you initialize your variables in script as indicated above, you'd call a general catchall sub in your script with the appropriate triggers. Since I'm familiar with the application you're working on, we'll call this:
Sub AfflictOn(a,b,c)
DoCures()
End Sub
Name your trigger, for example:
Trigger: "your movement through the time stream is slowed."
The name of that trigger could be "Aeon1".
Within the affliction catch sub, we'd then do a simple check.
Sub AfflictOn(a,b,c)
If a = "Aeon1" Then
affliction_aeon = vbTrue
Endif
DoCures()
End Sub
However, since you've got tons of these you'll be checking, use a Select statement instead of multiple Ifs. You'll pick up some speed there.
Now, whenever you get hit with your various affliction triggers, you'll call this Sub which will set the VBScript variable. Since that information only has to be passed once (per trigger hit) rather than making a callback to MC for every logic check, this will improve your speed nicely. Simply put, we're reducing the number of times that information has to get from MC to the script (getvariable).
You would do the same for cures, too.
Sub AfflictOff(a,b,c)
If a = "AeonCure1" Then
affliction_aeon = vbFalse
Endif
End Sub
Pardon if the code is poor, it's been a while since I've dealt with VBScript. I'm pretty sure it's clean, though. |