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


Joined: 24 Aug 2002
Posts: 3
Location: USA

PostPosted: Sat Aug 24, 2002 12:03 am   

Need help w/ simple "I'm dying, heal" trigger
 
I'm having a little trouble writing my first real trigger. I'm trying to get it such that when I drop below 2000 hp I automatically cast a heal spell on myself.

Here's what I've got so far:

#SETPROMPT "<" hp maxhp mana maxmana
-- which works just fine, and fills the @hp, @maxhp, @mana, and @maxmana fields

and

#TRIGGER {#IF (hp<2000) heal}
-- which doesn't work at all.

What am I missing? How do you get zMud to send a command based on what's in your status line? I know this must be possible, but a few hours of thrashing through the help files hasn't given me the answer...

Thanks!

Meedrax.
Reply with quote
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Sat Aug 24, 2002 12:29 am   
 
Provided your prompt looks something like this:

<2000/2000 1500/1500 500/500>

#TR {~<%d/%d} {#IF (@hp < 2000) {heal} {#NOOP}}

The triggering portion doesnt have to match your entire prompt, just enough of it to distinguish it from anything else.

I'm certainly not an expert. Someone else take a stab if i've fouled up somewhere.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Aug 24, 2002 12:30 am   
 
Just a few typos

#TRIGGER {#IF (@hp<2000) {heal}}

Fatal Error!?! What do you mean Fatal Error... NO Dont format you silly thing. *sigh* Back to the Drawing board.
Reply with quote
Meedrax
Newbie


Joined: 24 Aug 2002
Posts: 3
Location: USA

PostPosted: Sat Aug 24, 2002 12:40 am   
 
OK, I now have:

#TRIGGER {#IF (@hp<2000) {heal}}

... but it still doesn't seem to work. In the Triggers window, under Test, I see:
#IF 1500<2000 heal

But no "heal" command is ever sent. Do I need to define "heal" as an alias under zMud?

Thanks for your help!

Meedrax.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Aug 24, 2002 1:22 am   
 
I spose If I help ya had something to trigger off of

SOOOO Here Goes

IF your prompr looks like this

<1400/2000 hps blah blah blah

Then you want a trigger to do this

#tr {^~<(%d)/(%d) hps} {#if (%1<2000} {heal command here}}

Set it up to trigger on prompt
and it will heal anytime you have less that 2000 Hps

Maybe someone will clean it up for ya :P

Fatal Error!?! What do you mean Fatal Error... NO Dont format you silly thing. *sigh* Back to the Drawing board.
Reply with quote
Etheriel
Newbie


Joined: 24 Aug 2002
Posts: 3
Location: USA

PostPosted: Sat Aug 24, 2002 7:04 am   
 
triggering on the prompt to heal works good, but if the mud uses any sort of balance to prevent you from healing infinite times in a short time you'll need to do a bit of creative coding.

on the mud I play, the heal command is 'drink health', this throws off your 'balance' for that elixer, and drinking it again will cause it to do no good (and waste it) I naturally have this aliased to 'DH', which sets 'dh=0'

when I regain balance, it says something to the effect of "you may drink another health or mana elixer", which executes "dh=1"

so with this prompt:
H:3300 M:3300 B:99% [??]
I just trigger like this:

#trigger {H:(&hp) M:(&mp)} {#if (@hp < 3000 AND @dh=1) {dh}}

this basically just tells if 'do you need to drink? if so, can you drink? if you can--drink'

Hope this helps.
-Etheriel



#killall //dont put this in an alias.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Aug 24, 2002 7:09 am   
 
The #TRIGGER command has several parts. First is the command itself, #TRIGGER. Next, is the phrase/expression which will cause the trigger to fire. You tried to skip this part and go right to the third part, the command(s) to be executed when the trigger fires. However, since the second part is required, your commands were used as the trigger phrase.

You need to do something like doomfyre suggested in the first place. That is, write a trigger to match the beginning of your prompt. The options on this trigger will need to be "Trigger on Prompt" enabled, "Trigger on Newline" disabled. You'll also need some form of control to prevent the trigger from firing during the time you take to cast the spell.

Healing triggers are a frequent topic, you can probably find something that will match your MUD if you do a search. If you'd like someone here to provide a script, we'll need to know what your prompt looks like, what command you use to heal ("heal" isn't usually a command -- "cast heal" or "quaff potion" is), how you tell when the healing is finished ("you feel much better now"), how you tell if the healing doesn't work ("you lost your concentration"), and how much you want to heal (just over 2000 hp, all the way to max hp, or somewhere in between?). Anything else you think might be helpful would also be a good idea.

LightBulb
Senior Member
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