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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
talonnb
Apprentice


Joined: 30 Oct 2004
Posts: 127

PostPosted: Tue Apr 13, 2010 10:56 pm   

Multistate Trigger Help
 
So, I'm sure many of you have seen a set of lines like this.

H:4300 M:5194 E:20400 W:24900 B:100% Spark:100% XP:78% [csdb eb]
You eat a goldenseal root.
You are no longer dizzy.
H:4300 M:5194 E:20400 W:24900 B:100% Spark:100% XP:78% [csdb eb]

So I made a multistate trigger, that fires on the 'eating' message to just color the words yellow to point it out to me, then a conditional trigger of ^(*)$

So I want it to trigger like this,
#if (@plantcured = "You are no longer dizzy.") {}

but I'd also like it to trigger the prompt so that it will reset if nothing was cured, as shown

H:4300 M:5194 E:20400 W:24900 B:100% Spark:100% XP:78% [csdb eb]
You eat a goldenseal root.
H:4300 M:5194 E:20400 W:24900 B:100% Spark:100% XP:78% [csdb eb]

The problem is, the withinline option also triggers the prompt ABOVE it. Is there any way to only trigger lines 'after' the original?
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Wed Apr 14, 2010 12:24 pm   
 
#TRIG {You eat a goldenseal root.$^([Y|H])} {#IF (%begins(%1,"Y")) {#show {I am HEALED!!}} {#show {Crap.. still DIZZY!!}}}

You eat a goldenseal root.
You are no longer dizzy.
I am HEALED!!


You eat a goldenseal root.
H:4300 M:5194 blah blah
Crap.. still DIZZY!!

Sometimes the old ways are the easiest :)
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Apr 14, 2010 12:52 pm   
 
Using the $ in the middle to handle multiple lines is currently considered a poor solution, but you're right, that does work, Private.

The correct solution using a multistate trigger is to set the Type of the condition to be Within Lines, and a parameter of one. I'm not sure what you mean that this triggers on the line above it. Could you explain what you mean?
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Wed Apr 14, 2010 4:56 pm   
 
not sure, but does WithinLines=1 match any direction within 1 line? if so, that is his issue
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Apr 14, 2010 5:11 pm   
 
No, CMUD cannot go "back in time". It means the second condition will match if the pattern is received within the "next" N lines.
Reply with quote
talonnb
Apprentice


Joined: 30 Oct 2004
Posts: 127

PostPosted: Wed Apr 14, 2010 7:30 pm   Thanks!
 
Thanks Zugg, tis what I thought, but someone told me otherwise and I really didn't feel like writing elaborate code just to prove him wrong.
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Thu Apr 15, 2010 6:18 am   
 
cmud can go "back in time" ... #GAG -1

i didnt think WithinLines matched previous lines... but had never tried nor wanted to though

anyways, if you still want a multistate trigger...

Code:

#TRIG {^You eat a goldenseal root.$}
#COND {^(?)} {#IF (%1 = "Y") {plantcured = yes}} {plantcured = no;eat goldenseal again or whatever}} {within|param=1}


btw, Rahab, why a poor solution? is it bugged? or is it just because there are conditionals now? if the latter, i dont see why it's a poor solution other then the trigger tester never has been able to handle testing multiline triggers
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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