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.
HP variables
Moderator: Moderators
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: HP variables
Code: Select all
while ($.hp < $variable) as loop
-
- Noob
- Posts: 3
- Joined: 07 Jun 2012, 14:22
- Noob?: Yes
Re: HP variables
thanks.
Another doubt, there is any way to get % of hp or character max hp?
Another doubt, there is any way to get % of hp or character max hp?
-
- Moderators
- Posts: 1202
- Joined: 16 Dec 2011, 02:53
- Noob?: No
- Location: Brazil
Re: HP variables
You could try this :
Or, if code above don't works, you can try also this :
If don't work, try :$hp_percent = eval (return $::char->{hp_percent})
log My HP in percent is $hp_percent%
Code: Select all
$hp_percent = eval (return $::char->hp_percent)
Or 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
Learn rules