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


Joined: 23 Nov 2006
Posts: 2

PostPosted: Thu Nov 23, 2006 12:11 am   

Help me out with a trigger
 
Need some help, how do i make a trigger that executes when
My mana reaches over 1300 AND my hp over 400?
here's the prompt
(433/433hp 1385/1385mp 485mv 806tnl)
Reply with quote
xenapan
Wanderer


Joined: 26 May 2004
Posts: 68

PostPosted: Thu Nov 23, 2006 12:53 am   
 
you need two triggers. first is one that captures your prompt.
^~(&hp/&maxhphp &mana/&maxmanamp
should be your pattern. it will store the numbers to the corresponding variables.

then...
you need some pattern here. to trigger it.
#if(@mana>1300) {#if (@hp>400) {do what you want here}{}} {}

thing is... most muds tend to show the prompt EVERY time you hit a command. which will cause your trigger to activate as many times before it actually does something.
_________________
Player on Realms of Despair. realms.game.org port 4000. Join us today!
Reply with quote
Snikten
Newbie


Joined: 23 Nov 2006
Posts: 2

PostPosted: Thu Nov 23, 2006 1:40 am   
 
thx for the quick response
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Nov 23, 2006 4:20 am   
 
#VAR prompttriggered 0 0

#if ((@mana>1300) and (@hp>400) and (!@prompttriggered)) {do what you want here;#VAR prompttriggered 1;#TEMP prompttriggeredreseter {You cast boo} {#VAR prompttriggered 0}}

You might want to consider a flag for when or not to when to fire the trigger. If you get a prompt with mana>1300 and hp>400 four times in a row, due to lag, then you'll cast four times. You might want a toggler that turns on and off.
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