|
Flow Newbie
Joined: 12 Dec 2003 Posts: 8
|
Posted: Fri Dec 12, 2003 11:33 pm
Queues (Achaea) |
Well currently my triggers just check if i have herb balance, eat the herb if i do, or #echo what herb i need to eat if not. What i'm looking for is a beginner's [:I] guide to making queues and priority. Could someone give me a hand?
|
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Sat Dec 13, 2003 4:06 am |
You'd need some examples from your mud, flow. Like text for when to take off from the queue, when to put on etc.
|
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Sat Dec 13, 2003 4:19 am |
This is a very basic sort by importance way. Not sure what all you are looking for.
#VAR HerbImportance (herb1|herb2|herb3|herb4}
#ALIAS EatHerb {#FORALL @HerbImportance {eat %i}
just type: EatHerb and it will loop through the string list and "eat" (don't know what command you use) an herb of each type. |
|
|
|
Flow Newbie
Joined: 12 Dec 2003 Posts: 8
|
Posted: Sat Dec 13, 2003 11:16 am |
OK - this is what i have
Variable: herbbalance
Trigger: Pattern: You may eat another plant. Value: #CW high,green #VAR herbbalance true
Trigger: Pattern: (affliction message) Value: #CO 1245 #IF(@herbbalance) {outr ash; eat ash; #VAR herbbalance false} {#ECHO You need to eat ash!}
Currently the settings on that las trig don't seem to set the variable to false though, so could someone help with that as well. |
|
|
|
Flow Newbie
Joined: 12 Dec 2003 Posts: 8
|
Posted: Sat Dec 13, 2003 11:25 am |
When i get the affliction message, it eats the herb when herbbalance is true, it just doesn't seem to set it to false
|
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Sat Dec 13, 2003 2:40 pm |
Part of the problem may be using "true" and "false" for your herbbalance. These are treated as strings and not boolean. I'd suggest using 0 for false and 1 for true instead.
Also, you'll probably want to only set the herbbalance to 0 when you actually eat the herb and not just when you try to eat it. This is a problem with many systems.
Larkin |
|
|
|
Flow Newbie
Joined: 12 Dec 2003 Posts: 8
|
Posted: Sat Dec 13, 2003 5:16 pm |
Now what i have: Variable: herbbalance
Trigger: Pattern (affliction message) Value: #CO 1245
#IF (@herbbalance) {outr ash; eat ash} {#ECHO You need to eat ash!}
Trigger: Pattern: You eat a piece of *****ly ash. Value: #VAR herbbalance 0
Trigger: Pattern: You may eat another plant. Value: #VAR herbbalance 1
This seems to work... Anyone see any probs? |
|
|
|
Flow Newbie
Joined: 12 Dec 2003 Posts: 8
|
Posted: Sat Dec 13, 2003 5:19 pm |
or should it be
#IF (@herbbalance=1) {outr ash; eat ash} {#ECHO You need to eat ash!}
(the =1 part) |
|
|
|
user0101 Apprentice
Joined: 01 Aug 2003 Posts: 100 Location: USA
|
Posted: Sat Dec 13, 2003 7:00 pm |
#IF (@herbbalance) will just check to see if there is ANYTHING in the variable. If the value isn't null it will run the true portion of your if check. Try using ToeTag's example and see how it works.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Dec 14, 2003 6:11 am |
Not quite true. If @herbbalance is 0 the FALSE portion will be run.
|
|
|
|
|
|