|
Zion Beginner
Joined: 26 Mar 2004 Posts: 18
|
Posted: Fri Apr 09, 2004 6:23 am
A way to stop spamming of trigger? |
Ok, I want my trigger to heal me if my hit points go under 350
so here's the prompt:
{HP:672/672 MA:295/402 MV:665/684} 19977
here's my trigger:
Pattern:
~{HP:&hpc/&hpt
Command:
#IF (@hpc < 350) {
poke zion
#WA 3000
}
now the problem isn't that it isn't working, the problem is, it's spamming, it heals, but there's a delay on the heal and it's sending the command repeatedly, so i'm sending like 15 requests before I actually get healed. Is there a way to stop that? I thought the wait would, but it doesn't seem to |
|
|
|
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Fri Apr 09, 2004 7:07 am |
quote: Originally posted by Zion
Ok, I want my trigger to heal me if my hit points go under 350
so here's the prompt:
{HP:672/672 MA:295/402 MV:665/684} 19977
here's my trigger:
Pattern:
~{HP:&hpc/&hpt
Command:
#IF (@hpc < 350) {
poke zion
#WA 3000
}
now the problem isn't that it isn't working, the problem is, it's spamming, it heals, but there's a delay on the heal and it's sending the command repeatedly, so i'm sending like 15 requests before I actually get healed. Is there a way to stop that? I thought the wait would, but it doesn't seem to
There's quite a few ways you can deal with this.
If your mud gives you a message when you heal then you can either
disable the trigger using #t- in the command before you heal, and use the heal message to enable it again (#t+) or use a boolean variable, here's an example : i dont know what your mud sends when you heal but for the example we'll use these 2 triggers
Code: |
#TRIGGER {You feel better after you heal yourself} {bhealing = 0}
#TRIGGER {You fail to heal yourself} {bhealing = 0}
#TRIGGER {~{HP:&hpc/&hpt} {#IF (!@bhealing && @hpc < 350) {bhealing = 1;poke zion}}
|
Jesse |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Apr 09, 2004 4:50 pm |
Don't use #WAIT in triggers!Read Zugg's article in the Support Library if you want to know why.
You also have a problem with &hpc and &hpt. You didn't specify a wildcard type, so they use the default * type. That means that either of them can match almost the entire line. I usually make variables as part of the trigger's commands in order to avoid any possibility of this happening. However, if you must make variables in the pattern, at least specify what type of wildcard you intend.
For COMMMAND LINE entry.
#TR poke {~{HP:&%dhpc/&%dhpt} {#IF (%1 < 350) {poke zion;#STATE poke 1}} {} {manual}
#COND {} {} {Wait|Param=3000}
HINT: The command line is the one-line box at the bottom of the main screen where you enter commands for the MUD |
|
|
|
Zion Beginner
Joined: 26 Mar 2004 Posts: 18
|
Posted: Sat Apr 10, 2004 4:09 am |
LightBulb, I did exactly what you did, but it still spams off?
|
|
|
|
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Sat Apr 10, 2004 4:33 am |
That should work the way its written. But you may be having problems because the wait option on a trigger isnt your best option, it's very good for certain things like muds that penalize you for spamming so you can delay recast, or to tick for certain amount of time and stand up again etc... But in your case you dont want to heal again in a certain amount of time. You want to heal, then re-evaluate your hps.
So you should go with one of the methods I mentioned above.
Cheers, Jesse |
|
|
|
Zion Beginner
Joined: 26 Mar 2004 Posts: 18
|
Posted: Sat Apr 10, 2004 5:14 am |
Jessew, you're is 3 seperate triggers right?
Trig 1:
Trigger: You feel better after you heal yourself
Command: bhealing = 0
Trig 2:
Trigger: You fail to heal yourself
Command: bhealing = 0
Trig 3:
Trigger: HP:&hpc/&hpt
Command: #IF (!@bhealing && @hpc < 350) {bhealing = 1;poke zion}
of course the feedback messages would be specific? but the first error I got was from && I changed that to AND, but it also wasn't working correctly. Am I doing something wrong? |
|
|
|
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Sat Apr 10, 2004 5:36 am |
&& is different from AND, AND i believe in zmud will actually perform the bitwise AND operation.
That was my bad it was only supposed to be one ampersand , #IF(!@bhealing & @hpc < 350)
Yes and replace these two triggers with the messages you get for a successful heal , and a failed heal
Trigger: You feel better after you heal yourself
Trigger: You fail to heal yourself
and define bhealing as
#VARIABLE bhealing 0 0
Jesse |
|
|
|
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Sat Apr 10, 2004 5:48 am |
and here's the example for turning triggers on and off. Once again since i don't know what messages you get, ill substitute my fake ones.
Code: |
#TRIGGER "healtrig" {~{HP:&hpc/&hpt} {#IF (@hpc < 350) {poke zion;#t- "healtrig"}
#TRIGGER {YOUR_MESSAGE_FOR_A_SUCCESSFUL_HEAL_CAST} {#T+ "healtrig"}
#TRIGGER {YOUR_MESSAGE_FOR_A_FAILED_HEAL_CAST} {#T+ "healtrig"}
|
Jesse |
|
|
|
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Sat Apr 10, 2004 7:08 am |
Ok nevermind about the whole AND thing i got confused :)
that *should* of worked the way you had it, what was happening?
Jesse |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Apr 10, 2004 12:44 pm |
LightBulb's trigger does not cause a loop for me. The only way it could cause a loop if is poke is an alias that produces some output that makes the trigger match again.
|
|
|
|
Zion Beginner
Joined: 26 Mar 2004 Posts: 18
|
Posted: Sun Apr 11, 2004 2:09 am |
Jessew:
The problem is, the HP trigger doesn't match my prompt?
{HP:1047/1047 MA:674/674 MV:1152/1152} 50398
I've tried testing it, but with the "healtrig" I don't think it's working
Trigger 1:
Pattern: "healtrig" {~{HP:&hpc/&hpt}
Value: #IF (@hpc < 900) {
poke zion
#t- "healtrig"
}
Trigger 2:
Pattern:
You feel a warm healing force flow through your body.
Value:
#T+ "healtrig"
Trigger 3:
Pattern:
Zion says 'I lost my concentration'
Value:
#T+ "healtrig" |
|
|
|
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Sun Apr 11, 2004 2:26 am |
Ok, from your other post im assuming your using zmuds settings editor to add your triggers. "healtrig" was not meant to be part of the pattern, It's the ID, when using the editor switch to the options tab on your prompt trigger and type in healtrig under ID. That should solve your problem.
Cheers Jesse |
|
|
|
Zion Beginner
Joined: 26 Mar 2004 Posts: 18
|
Posted: Tue Apr 13, 2004 1:45 am |
Hey, just wanted to say thank you to both jessew and lightbulb, it works now.
|
|
|
|
|
|