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


Joined: 27 Feb 2003
Posts: 2
Location: USA

PostPosted: Fri Feb 28, 2003 12:42 am   

Trigger to report health
 
I play a Circle 2.2 mud and have been a registered Zmud user for several years, and now I want to make a trigger to report when one of my charactor's health reach a certain number...have never made anything like this and to be honest, I dont really understand the terminology when reading help files.
Any help appreciated
Respectfully
Crueltiming
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Feb 28, 2003 6:19 am   
 
Syntax: #TR [id] pattern command [classname] [options]

The first part is the command, #TRIGGER (often abbreviated to #TR). (see helpfile Contents/Command Reference/TRIGGER)

Next comes the ID field. This is optional and isn't used for this example.

Next you'll need a pattern. This is something the MUD sends to you which shows your character's health. Some possibilities include your prompt, your score, and the combat scroll. The portion of the pattern which contains your health should use a wildcard (%d for digits or %n for numbers) and be surrounded by parentheses () so that it can be used in the next part. (see helpfile Contents/Command Reference/Pattern matching)

The next part contains the commands you want the trigger to perform. In this case, you'll want to compare your health to some predetermined number. The #IF command would be an appropriate method, with a less-than comparison. (see helpfiles Contents/Command Reference/IF and from the #IF topic, click the link to Expressions)

The next part of the command is the Class field, you shouldn't need it at this point so you can just leave it blank.

Finally, there's the Options field. If you're using your prompt for the pattern, you'll want to include the Nocr and Prompt options. Otherwise, you can probably skip both of the last two fields.

Combining all that, you'd get something along these lines
#TR {Your have (%n) health} {#IF (%1 < 570) {report}}
or
#TR {(%n)/(%n)hp} {#IF (%1 * 5 < %2) {report}} {} {nocr|prompt}

LightBulb
Advanced 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