Vesar2005-08-23 01:53:13
Someone tell me why this isn't working? I'm sure there's some stupid mistake that I'm making but I've been staring at it too long and I need a new set of eyes to help me out.
#TRIGGER {You take a drink from a * vial.} {
 #var SippingPotion 0
 #say test 1
 }
#COND {(%d)h, (%d)m, (%d)e, (%d)p ()-} {#say test 2} {within|param=1}
All I want it to do is the "#say test 2" if I drink a vial and nothing happens (Eventually this will be my sipping loop check).
CODE
#TRIGGER {You take a drink from a * vial.} {
 #var SippingPotion 0
 #say test 1
 }
#COND {(%d)h, (%d)m, (%d)e, (%d)p ()-} {#say test 2} {within|param=1}
All I want it to do is the "#say test 2" if I drink a vial and nothing happens (Eventually this will be my sipping loop check).
Unknown2005-08-23 01:54:09
For this part:
#COND {(%d)h, (%d)m, (%d)e, (%d)p ()-} {#say test 2} {within|param=1}
I don't see willpower in there. Do you have it up on your prompt?
#COND {(%d)h, (%d)m, (%d)e, (%d)p ()-} {#say test 2} {within|param=1}
I don't see willpower in there. Do you have it up on your prompt?
Vesar2005-08-23 01:56:03
No, I don't. I've checked and re-checked the patterns and they both pass seperately. The problem lies in the conditional parameters, I'm convinced.
Unknown2005-08-23 02:41:41
Stop banging your head against the wall, it has little to nothing to do with coding.
Kids these days...
But seriously, no idea, just being silly.
Kids these days...
But seriously, no idea, just being silly.
Corr2005-08-23 02:43:00
Two things, One, you might want to take out the elrx stuff from the prompt and test that.
Second, I don't get your param=1 thing.
Shouldn't that be within the trigger?
Second, I don't get your param=1 thing.
Shouldn't that be within the trigger?
Unknown2005-08-23 02:47:52
Nope
That looks like it should work...
That looks like it should work...
Unknown2005-08-23 10:50:13
Try changing your conditional's parameters to {within|param=1|nocr|prompt} so it triggers on a prompt properly.
If you're going to trigger on a prompt and you don't actually want to capture all those values, it's marginally faster if you don't capture. I would just use a simple pattern that works for any and all prompts, such as "^%dh, %dm" and leave it at that.
If you're going to trigger on a prompt and you don't actually want to capture all those values, it's marginally faster if you don't capture. I would just use a simple pattern that works for any and all prompts, such as "^%dh, %dm" and leave it at that.
Vesar2005-08-23 12:35:56
Ok, as per suggestion, I changed it to this:
#TRIGGER {You take a drink from a * vial.} {
 #var SippingPotion 0
 #say test 1
 }
#COND {(%d)h, (%d)m,} {#say test 2} {within|param=1|nocr|prompt}
No dice.
CODE
#TRIGGER {You take a drink from a * vial.} {
 #var SippingPotion 0
 #say test 1
 }
#COND {(%d)h, (%d)m,} {#say test 2} {within|param=1|nocr|prompt}
No dice.
Soll2005-08-23 12:42:24
QUOTE
3842h, 4766m, 3380e, 10p, 18078en, 22730w ex---/13:41:10.937/ sip health
test 1
The potion heals and soothes you.
3842h, 4766m, 3380e, 10p, 18110en, 22730w ex---/13:42:07.984/ test 2
test 1
The potion heals and soothes you.
3842h, 4766m, 3380e, 10p, 18110en, 22730w ex---/13:42:07.984/ test 2
Hrmmmm...
Unknown2005-08-23 12:42:30
Well, works for me, so the problem is elsewhere it seems.
Vesar2005-08-23 12:52:46
Argh?! Why??!?
Vesar2005-08-23 12:54:41
QUOTE(Soll @ Aug 23 2005, 07:42 AM)
Hrmmmm...
171105
I'll assume you have your vial drinking gagged? This trigger shouldn't work if the potion does anything, like heals and soothes you.
Soll2005-08-23 13:08:15
Yeah. Seperate thing gags it.
Corr2005-08-23 17:00:08
CODE
#TRIGGER {You take a drink from a * vial.} {
 #var SippingPotion 0
 #say test 1
#COND {(%d)h, (%d)m, (%d)e, (%d)p} {#say test 2} {within|param=1}
}
170923
I ment try that, but it probabbly won't work.
Soll2005-08-23 17:26:31
Nope. Conds are seperate from triggers.
Unknown2005-08-23 21:01:30
If you have a trigger that gags a message, your other triggers are likely to not fire at all on that same message. Another possibility is if you have an echo on sipping a vial, like a sip counter, and there is a line inserted between the game's sip message and the prompt, causing the "within 1 line" thing to fail.
Conditionals aren't separate from triggers, exactly. They add states to the trigger before them, so they are triggers themselves, and only enabled when the previous state is fired.
Conditionals aren't separate from triggers, exactly. They add states to the trigger before them, so they are triggers themselves, and only enabled when the previous state is fired.
Vesar2005-08-24 01:29:35
I got it working, though I'll be honest... I don't know what I did or why this is working and the other one isn't. Could be a zMud quirk.
#TRIGGER {You take a drink from {a|an} (*) vial.} {#var SippingPotion 0}
#COND {(%d)h, (%d)m,} {potionReset @LastPotion} {within|param=1}
Edit: I took out the #say and added the potionReset AFTER I got it working. Again, no idea why it wasn't working before.
CODE
#TRIGGER {You take a drink from {a|an} (*) vial.} {#var SippingPotion 0}
#COND {(%d)h, (%d)m,} {potionReset @LastPotion} {within|param=1}
Edit: I took out the #say and added the potionReset AFTER I got it working. Again, no idea why it wasn't working before.
Unknown2005-08-24 11:04:19
As I suggested, your first #SAY was probably causing the "within one line" part to fail. You inserted a line and threw off the second state. This has happened to me before.
Vesar2005-08-24 12:11:51
Nope, because neither state was firing before. I had it working with both the says in there before I took them out and replaced them with the above.