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


Joined: 11 Jun 2004
Posts: 1
Location: USA

PostPosted: Fri Jun 11, 2004 7:43 pm   

Percentage healing...
 
I am wanting to create some triggers to go off when my promt hits a certain percentage or less of my hp and sp. Could you assist me on this please? Thanks.

Here is my prompt trigger and variable setup:

HP:(*)/(*) SP:(*)/(*) XP:(*) AP:(*)/(*) MOB:(*)

#VA hp %1
#VA maxhp %2
#VA sp %3
#VA maxsp %4
#VA xp %5
#VA apusuable %6
#VA aptnl %7
#VA mob {%8}

I'm wanting to set up a way to heal my hp when it hits 50% or less by using the command line: use holymagic cure4 and heal my sp when it hits 25% or less by using: use item xether

I appreciate all the assistance I get on this matter. Thanks!
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Jun 11, 2004 8:09 pm   
 
First clean up your pattern (for faster matching) by using (%d) instead of (*) for numbers

after #va maxhp %2
#IF (%1>%eval(%2*50/100)) {heal=1}
#IF (%1<%eval(%2*50/100) AND @heal) {heal=0;use holymagic cure4}

And A new trigger change the pattern to whatever message after a heal make another for fail
#TRIGGER {You feel better} {heal=1}

And do the same things for SP
NOTES: this should disable allowing heal until your healed or hp is more then 50% so that if you get spammed with prompts you won't cast a million heals. I also think my math is correct but I could be wrong :P and this is untested but I think should work
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