I do something like this for another mud I play.
Quote: but say, the trigger you may eat another herb is not sent off, and then the hole thing would not go off, so say you get hit with
You are infected with semideadly posion
You are infected with Deadly posion
You are infected with posion
and when you get it the first one, could you do like
GetVariable ("Herbbal") = 0 then
send "eat green herb" then
SetVariable "deadlyosion", 1
or something like that?
What you could do, is trigger ea. affliction to go through sort of a queue, so to speak.
I.E. Trigger
You are infected with semideadly posion
to call this sub routine:
Sub SemiDeadly_Poison (a,b,wildcard)
If World.GetVariable("Herbbal") = 1 then
World.Send "eat semideadly poison cure"
World.SetVariable("Herbbal") = 0
End Sub
And what that does is, checks to see if you have herb balance (1 means true, or, you have herb balance), if so, send the command to cure yourself, and then set your herb balance variable to 0 (0 means false, or, you don't have herb balance.
Then you could do that for all of them, as well as have a small "queue" for your afflictions set to set off on the herb balance trigger. A more complex example would be something like this, and so I don't confuse you, I'll leave the actual triggers out.
Trigger Pattern: You are infected with semideadly posion
calls Subroutine: SemiDeadlyPoison
Trigger Pattern: You are infected with deadly posion
calls Subroutine: DeadlyPoison
Trigger Pattern: You are infected with posion
calls Subroutine: Poison
Trigger Pattern: You are cured of the semideadly posion
calls Subroutine: SemiDeadlyPoison_Cure
Trigger Pattern: You are cured of the deadly posion
calls Subroutine: DeadlyPoison_Cure
Trigger Pattern: You are cured of the posion
calls Subroutine: Poison_Cure
Trigger Pattern: You may eat another herb
calls Subroutine: Herb_balance
Dim SDPoison, DPoison, RegularPoison, HerbBalance
SDPoison = 0
DPoison = 0
RegularPoison = 0
HerbBalance = 1
Sub SemiDeadlyPoison (name,output,wildcard)
SDPoison = 1
If HerbBalance = 1 then
World.Send "eat semi deadly cure"
HerbBalance = 0
End If
End Sub
Sub SemiDeadlyPoison_Cure (name,output,wildcard)
SDPoison = 0
End Sub
Sub DeadlyPoison (name,output,wildcard)
DPoison = 1
If HerbBalance = 1 then
World.Send "eat deadly cure"
HerbBalance = 0
End If
End Sub
Sub DeadlyPoison_Cure (name,output,wildcard)
DPoison = 0
End Sub
Sub Poison (name,output,wildcard)
RegularPoison = 1
If HerbBalance = 1 then
World.Send "eat reg poison cure"
HerbBalance = 0
End If
End Sub
Sub Poison_Cure (name,output,wildcard)
RegularPoison = 0
End Sub
Sub Herb_Balance (name,output,wildcard)
If SDPoison = 1 then
World.Send "eat semi deadly poison cure"
HerbBalance = 0
ElseIf DPoison = 1 then
World.Send "eat deadly poison cure"
HerbBalance = 0
ElseIf RegularPoison = 1 then
World.Send "eat regular poison cure"
HerbBalance = 0
End If
End Sub
Now, the explanation. The trigger patterns are the triggers you'd put into the mud client itself. You'd put the name of the respective sub routines in the "Script" part. You'd need to make a script file, and put all of the vbscript code into that.
Dim SDPoison, DPoison, RegularPoison, HerbBalance
That's where you make all of the variables you want to use for your script. Note, these aren't permanent, and if you close the world, everything that's in there goes away. Under that, is where you define your variables. Obviously, when you log on, you're generally going to be clean of afflictions, and going to have herb balance. those four variables can be 1 or 0. 1 means you have it, 0 means you don't. So if SDPoison is 1, then you have the affliction. The sub "Poison" for example, checks to see if you have herbbalance, if you do, it eats the cure for it, and sets herbalance to off. When you actually cure the affliction, another subroutine is called and then sets the appropriate variable to off. When you get Herb balance back, it calls a subroutine called Herb_balance, that has a "queue" of afflictions listed in it, and it goes through these if statements to see what afflictions you have. If you have the first one, it'll heal it, then stop there. If you -don't-, it'll move on to the next affliction in the queue. Etc. Etc. This is -really- basic, and I would do stuff like, turn herb balance off when I actually eat an herb, etc. I hope this helps, post back if you have any questions (and this post is kinda sloppy, so I reckon you will :p) |