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
yazig
Newbie


Joined: 08 Aug 2003
Posts: 7

PostPosted: Fri Aug 08, 2003 5:09 am   

autohealer AGAIN
 
Hi, I need some help with an autohealer trigger...I've looked through
all the previous ones and I think I understand..but I still have problems.

text i want to trigger on...when hp are below ..say 100
(725 is the current hp below)

<* 725(776) 227(300) : Drider is heavily bleeding. *>

i want below 100 hp to trigger drink potion for example
any help would be appreciated.
Reply with quote
zex0s
Wanderer


Joined: 29 Jun 2003
Posts: 64

PostPosted: Fri Aug 08, 2003 5:30 am   
 
Quite easy actually.. make a trigger pattern off your prompt like so.
#TR {~<~* (%d)~(%d~) %d~(%d~) ~:} {#IF (%1<100) {drink potion}} {nocr|prompt}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Aug 08, 2003 6:20 am   
 
Well, close. The syntax of the #TRIGGER command has a Class field before the Options field, so you need to include that even if it's empty. Also, you need some form of control so you won't immediately drink a second potion when you get the prompt following your "drink potion" command. In this example, I gave the trigger an ID, then used #T-/#T+ with a one-time alarm.

#TR autoheal {~<~* (%d)~(%d~) %d~(%d~) ~:} {#IF (%1<100) {#T- autoheal;drink potion;#ALA +2 {#T+ autoheal}}} {} {nocr|prompt}
Reply with quote
yazig
Newbie


Joined: 08 Aug 2003
Posts: 7

PostPosted: Fri Aug 08, 2003 6:59 am   
 
Thanks for all your help guys...so quick too...
it...almost works...
well for example..when i test the trigger..with this slightly
different but similar
<* 761(776) 193(300) : Nymph is in very bad shape. *>
it fails
...but it works with my pasted expression from my first question
now...is there something subtle going on with me pasting from the
mud? I'll try and hack it myself...but..since you guys are so quick... :)
Reply with quote
yazig
Newbie


Joined: 08 Aug 2003
Posts: 7

PostPosted: Fri Aug 08, 2003 7:01 am   
 
well now..that must be it...
since when I copy the status line from the above window from the previous post of mine..rather than from the zmud window..i get a match ! ..any ideas ?

Thanks
Reply with quote
yazig
Newbie


Joined: 08 Aug 2003
Posts: 7

PostPosted: Fri Aug 08, 2003 7:51 am   
 
Ok...I've gotten the pattern to match...the problem was..when i pasted to here for some reason some blank spaces were omitted in the trigger part...ok..got that fixed...patterns match when i test from the mud. However its not triggering the drink potion...
I do have triggers on !
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Aug 08, 2003 1:37 pm   
 
If the pattern matches, but the trigger doesn't fire, you probably have the options set wrong.

If the pattern line ends with a carriage-return (cursor is on next line), the default options should be used. That is, Newlined-checked/Prompt-not checked. If the pattern line doesn't end with a carriage-return (cursor is on same line), the options should be changed to Prompt-checked and usually Newline-not checked (that's the nocr|prompt stuff).

It's also possible that when you changed the pattern, you removed the () around the first %d. These are required for the trigger to operate properly. Since you've only made some vague comments about what you've done, instead of actually posting the changes, trying to figure out the problem becomes a guessing game.
Reply with quote
yazig
Newbie


Joined: 08 Aug 2003
Posts: 7

PostPosted: Fri Aug 08, 2003 4:40 pm   
 
The only change that I made to your suggested trigger sequence
Lightbulb (thanks again) is with regards to

#TR autoheal {~<~* (%d)~(%d~) %d~(%d~) ~:} {#IF (%1<100) {#T- autoheal;drink potion;#ALA +2 {#T+ autoheal}}} {} {nocr|prompt}

A space was lost in two places in what I pasted over as the triggering text which I added to make it work. namely I just added
a space between the hp and mana point reports, before the third
%d and i added another space before the tilde before the final colon
so it looks like this

#TR autoheal {~<~* (%d)~(%d~) %d~(%d~) ~:} {#IF (%1<100) {#T- autoheal;drink potion;#ALA +2 {#T+ autoheal}}} {} {nocr|prompt}

Again..not sure why those spaces were lost when I pasted them over
from the mud. Those are the only changes I"ve made. I"ll look at
your suggestions for making the other parts work. I just felt if
you wanted to know the specific changes i made...I owed you the
explanation.
thanks again
Reply with quote
yazig
Newbie


Joined: 08 Aug 2003
Posts: 7

PostPosted: Fri Aug 08, 2003 4:43 pm   
 
My word ! It took out the spaces I added when I posted so its exactly the same again ! Well...now I know that happens when I post
here...even when I add the spaces manyaly instead of typing. Wierd.
Reply with quote
yazig
Newbie


Joined: 08 Aug 2003
Posts: 7

PostPosted: Fri Aug 08, 2003 6:52 pm   
 
I've got the trigger working now after changing the options to
newline. That space removal was really throwing me for a loop...utterly confusing me and making me doubt things.
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