HP variables

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Random159753
Noob
Noob
Posts: 3
Joined: 07 Jun 2012, 14:22
Noob?: Yes

HP variables

#1 Post by Random159753 »

Hi for all,
today I was writting a macro and I stuck on the following problem.
I want to repeat a code while the character hp is less than a variable, but I don't found any way to do that.
Example:
while($.hp > 50) as loop
do something
end loop

don't know if there is any way to get the percent of HP or character max hp.

So, how I can do this?

I think I explained what I want to ask, thanks in advance and sorry my bad english.
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: HP variables

#2 Post by EternalHarvest »

Code: Select all

while ($.hp < $variable) as loop
Random159753
Noob
Noob
Posts: 3
Joined: 07 Jun 2012, 14:22
Noob?: Yes

Re: HP variables

#3 Post by Random159753 »

thanks.
Another doubt, there is any way to get % of hp or character max hp?
User avatar
SkylorD
Moderators
Moderators
Posts: 1202
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil

Re: HP variables

#4 Post by SkylorD »

You could try this :
$hp_percent = eval (return $::char->{hp_percent})
log My HP in percent is $hp_percent%
If don't work, try :

Code: Select all

$hp_percent = eval (return $::char->hp_percent)
Or, if code above don't works, you can try also this :
$hp = eval (return $::char->{hp})
$hp_max = eval (return $::char->{hp_max})
$hp_percent = eval(($hp/$hp_max)*100)
log My HP in percent is $hp_percent
Or this :
Learn rules