|
quigbrew Novice
Joined: 04 Jun 2002 Posts: 31
|
Posted: Wed Feb 12, 2003 4:08 am
states |
Okay, if someone out there could help me figure this out, it would greatly enhance my understanding of states, and I should be able to use this as a reference for future state triggers.
This from Achaea, and I'm sure there's better ways of doing it, but I'm trying to use it to grasp an understanding of states.
Trigger:
You apply a sileris berry to yourself.$
When you apply sileris to yourself, it hardens to help protect you against snake bites. But if you have another affliction, called slickness, it just slides off your slick body. Or, if you already have sileris on your body, you will apply it, but not get a response. So, what I'm trying to do is when I apply sileris, it sets my silerisbalance variable to 0 and sets my sileris variable to 1 automatically, this is so, if I run my healall alias again, it won't continually apply sileris. Anyway, what I want to do with states is: 1. check the next line after applying sileris for this message, "^You are too slick for the berry juice to take hold, and it is wasted.$" If I get this message, I want it to change the sileris variable to 0, and change the slickness variable to 1. But, if I don't get that message, and don't recieve the message telling me that it hardens, I know that I have sileris on me already, so I need to change my silerisbalance variable back to 1 and make sure my sileris variable is 1.
I hope that makes sense....Any help would be appreciated.
Oh, one more question. Occasionnaly triggers don't fall at the beginning of the line, instead they're directly after the prompt. I was wondering if there was anyway to make the trigger look for both ways. I already tried this, but it didn't seem to work.
{^|(%1)h, (%2)m (%3)-} I thought this would make sure the trigger would only work if at the beginning of the line or directly after the prompt, so I could avoid tells or says setting off my triggers.
Okay, thanks again. |
|
|
|
quigbrew Novice
Joined: 04 Jun 2002 Posts: 31
|
Posted: Wed Feb 12, 2003 10:15 am |
Okay, I might not of been very clear with what I was asking, basically, what I want to know is if there's a way to use states to search for a pattern, and if the pattern doesn't show up after x amount of seconds or lines, then it will run a predetermined command.
So, with my example it would look like this:
You apply a sileris berry to yourself.$
If the next line, shows that the sileris slid off, then I would want it to do certain sequence, if it doesn't slide off, then I would want it to continue to a third state that would search for a pattern saying, the sileris berry hardens, and if it doesn't find this pattern after 5 or so seconds, then it would do another predetermined sequence.
Hope that helps. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Feb 12, 2003 1:40 pm |
Yes, you can do that:
#TRIGGER "sileristrig "{You apply a sileris berry to yourself.$} {#VAR silerisbalance 0;#VAR sileris 1}
#COND {^You are too slick for the berry juice to take hold, and it is wasted.$} {#VAR sileris 0;#VAR slickness 1;#STATE "sileristrig" 0} {Within|Param=1}
#COND {The sileris berry hardens.} {#STATE "sileristrig" 0} {Dur|Param=5000}
#COND {} {#VAR silerisbalance 1;#VAR sileris 1}
Kjata |
|
|
|
|
|
|
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
|
|