 |
Kered Newbie
Joined: 07 Mar 2003 Posts: 5
|
Posted: Mon Jun 16, 2003 2:45 am
Prioritizing (how) |
Hey, I've started a new auto-healing script for Achaea, and I'm still learning the language that Zmud uses so basically I'm going to put an example here for you guys to look at and possibly help me with.
Code:
#CLASS {Autoqueuing|Herbs}
#VAR herbbalance {0}
-At the moment, this doesn't have a use, but I know I need to use it because the trigger that sets off the healing doesn't come until after you eat a plant.
#VAR herbqueue {}
#VAR herb {}
#TRIGGER {Your body stiffens rapidly} {#additem herbqueue {bloodroot}} "" {disable}
-What is the "" {disable} for at the end there?
#TRIGGER {You may eat another plant.} {herbbalance = 0;herb = %item( @herbqueue, 1);outb @herb;eat @herb;#delitem herbqueue {@herb};herbbalance=1}
#CLASS 0
#CLASS {Autoqueuing|Elixers}
#VAR elixerbalance {0}
-Same problem with the herbbalance here, only with elixers.
#VAR elixerqueue {}
#VAR elixer {}
#TRIGGER {You begin feeling slightly flushed.} {#additem elixerqueue {immunity}}
#TRIGGER {You may drink another affliction-healing elixer.} {elixerbalance = 0;elixer = %item( @elixerqueue, 1);drink @elixer;#delitem elixerqueue {@elixer};elixerbalance=1}
#CLASS 0
End Code
Ok, these two classes work the same way, just different types of healing. What I want to do is set it up so that the healing starts off when you get the affliction message, not the "You may eat another plant" message. This way it will heal without having to get the previous message. Now, I know that this will only need to do this once, because after you get the message, it should work fine. If I'm wrong in saying this, do tell. Now since this is Achaea, I would need to get it to keep adding herbs to the queue list while asleep, which happens often, or transfixed, etc. This could be done by running a trigger when you get an affliction that recognizes when a variable, say @sleep, is set to 1 or 0, and would decide whether or not to run through everything, or just add the affliction to the list.
Another thing I want to do with this is make it able to prioritize the type of plant/elixer you eat. In this case, I would need to set up the system to first recognize what affliction I was getting, and respond by giving the right type of herb to cure that certain affliction. Not only that, but it would need to know how important it would be to cure that certain affliction before others. I do not know how to move things up and down in a string list, so any help there would be quite useful, as well as any other help you can offer.
Tirelessly working,
Kered |
|
|
 |
Kered Newbie
Joined: 07 Mar 2003 Posts: 5
|
Posted: Mon Jun 16, 2003 4:50 am |
I also don't know how to make Zmud understand when or when there isn't a value inside of herbqueue. Since it doesn't know to not go through the trigger, it goes "outb (nothing);eat (nothing)" whenever the message "You may eat another plant." comes around. This screws up the deffing process, but could be easily fixed by making a macro or alias to disable the class when deffing.
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|