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
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Fri Sep 19, 2014 8:28 am   

Question
 
I have a trigger that saves my @hpPerc and @spPerc variables as percentiles:

hpPerc=%eval( (%float( %1)/%2)*100)
spPerc=%eval( (%float( %3)/%4)*100)
#SAY {HP is at @hpPerc of max}
#SAY {SP is at @spPerc of max}

I want to make an alias or command that allows me to keep 'donating' until my
SP and HP are within 10% of each other:


You donate 100 coins to the orphans.
Suddenly, a beam of light falls on you, soothing your soul.
** HP: 202/202 SP: 123/202
** HP: 190/202 SP: 123/202
0% 0% 0% r
You donate 100 coins to the orphans.
Suddenly, a beam of light falls on you, soothing your soul.
** HP: 190/202 SP: 149/202
** HP: 177/202 SP: 149/202
0% 0% 0% The Madonna smiles at you and says: Welcome! I am willing to heal you if you
help the orphans.
** HP: 180/202 SP: 155/202
r
You donate 100 coins to the orphans.
Suddenly, a beam of light falls on you, soothing your soul.
** HP: 180/202 SP: 180/202
** HP: 168/202 SP: 180/202
0% 0% 0% r
You donate 100 coins to the orphans.
Suddenly, a beam of light falls on you, healing your wounds.
** HP: 194/202 SP: 180/202
** HP: 194/202 SP: 167/202
0% 0% 0%





ALSO
0% 0% 0% is my prompt (tox% soak% %full)
I was hoping to be able to save these as variables
@toxPerc @soakPerc @fullPerc like I did with my @hpPerc and @Hp perc but I cant quite do it,
maybe I'm missing some parenthesis or something

I tried (*)% (*)% (*)%
@toxPerc=%1
@soakPerc=%2
@fullPerc=%3
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Sep 19, 2014 6:17 pm   
 
% is a special character in patterns. If you want to match a literal % symbol, you need to quote it: ~%
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Fri Sep 19, 2014 8:42 pm   
 
Ah, of course ;) Figured it was something small, thank you!

Any advice on how to keep track in the %difference between my @hpPerc and @spPerc?
I can't seem to find a proper help file for it
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Sep 20, 2014 5:32 pm   
 
You mean subtract them? %eval(@hpPerc - @spPerc)
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Sat Dec 06, 2014 6:39 pm   
 
Yes, thank you :)
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Sat Dec 06, 2014 6:39 pm   
 
Yes, thank you :)
_________________
It is better to die on your feet than to live on your knees.
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