Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Winger
Beginner


Joined: 23 May 2004
Posts: 14

PostPosted: Thu Sep 02, 2004 4:35 am   

Within Lines
 
I don't know what it is, maybe it's just my bad luck, or something, but I've been trying to work with "Within Lines" and it hasn't been working correctly. Let me explain the situation.
For starters, I want to match a trigger such as this.

^You eat a ginseng root.$

Now, the trigger I want to match ONLY if it immediently follows it, is my prompt, such as this:

^H: (%d) M: (%d)

However, it seems to match not only if it's immediently after, but also if it's within 2 lines of the "You eat a ginseng root."
So, for instance, when I get..


You eat a ginseng root.
Your stomach becalms itself.
H: 3038 M: 3740 B:100%

It finds it to be true, and executes the commands.

I've even tried using 0 lines, but that doesn't work at all.
Thanks for your help.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 02, 2004 10:37 am   
 
I can't duplicate this. Please post the scripts which are causing difficulty.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Winger
Beginner


Joined: 23 May 2004
Posts: 14

PostPosted: Thu Sep 02, 2004 10:48 am   
 
Code:
#TRIGGER {^You eat a ginseng root.$} {
  HerbBalance/herbbal = 1
  Balances/slike = 0
  HerbBalance/stunned = 0
  HerbBalance/badbelt = 0
  HerbBalance/badbelt1 = 0
  HerbBalance/eatingherb = 0
  callherb
  }
#COND {H:(%d) M:(%d)} {
  herbbal = 1
  haemophilia = 0
  darkshade = 0
  lethargy = 0
  vomiting = 0
  scytherus = 0
  addiction = 0
  callherb
  } {within|param=1}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Sep 02, 2004 12:41 pm   
 
I can't reproduce this. I get correct usage

Using

#TR {^TRIG$} {}
#TR {COND} {#SAY Within 1}
#SAT %cr //newline
#SAY TRIG;#Say COND
output=withing 1
#SAY %cr
#SAY TRIG;#SAY BLAH;#SAY COND
no trigger output
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Sep 03, 2004 2:33 am   
 
Okay, next post the script of 'callherb'.

What I'm looking for is what makes you think that the #COND fired when it shouldn't have. So far all I see is several variables set to 0 and a second use of 'callherb' which is probably an alias. Since the variables could easily already be 0, it's unlikely that their values would make you think the #COND has fired so it must be whatever's in the alias.

Then again, you might misunderstand the concept of multistate triggers. The first trigger state fires based on the first pattern, without regard to what the next line is. If you want the entire trigger to depend on getting both lines together, you need to move all the commands to the second state.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net