|
MyMiasma Wanderer
Joined: 26 Oct 2012 Posts: 56
|
Posted: 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. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: 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: ~%
|
|
|
|
MyMiasma Wanderer
Joined: 26 Oct 2012 Posts: 56
|
Posted: 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. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Sep 20, 2014 5:32 pm |
You mean subtract them? %eval(@hpPerc - @spPerc)
|
|
|
|
MyMiasma Wanderer
Joined: 26 Oct 2012 Posts: 56
|
Posted: Sat Dec 06, 2014 6:39 pm |
Yes, thank you :)
|
|
_________________ It is better to die on your feet than to live on your knees. |
|
|
|
MyMiasma Wanderer
Joined: 26 Oct 2012 Posts: 56
|
Posted: Sat Dec 06, 2014 6:39 pm |
Yes, thank you :)
|
|
_________________ It is better to die on your feet than to live on your knees. |
|
|
|
|
|