SRL Archive - Help

If hp lower than 30% do sth


begginer

2012-04-01 10:37:38

Tittle. How can I do that?

Sin

2012-04-01 11:14:59


if HPPercent > 30 then

begginer

2012-04-01 11:28:03

Not working. Tried like 10 times

Abu

2012-04-01 11:32:10

Hmmm, you must be doing something wrong then :confused:

Here's the definition for the function, make sure you're using it correctly:
(*
HPPercent
~~~~~~~~~

.. code-block:: pascal

function HpPercent: Integer;

Returns Hp left as a percentage.
Does not switch tabs if Players[CurrentPlayer].Level[SKILL_HITPOINTS] (HP level) is set.
Returns -1 if failed.

.. note::

by Wizzup?

Example:

.. code-block:: pascal
*)

Imagine

2012-04-01 11:33:27

It helps if you have:

Level[SKILL_HITPOINTS] := 99; //Change 99 to your MAX Hitpoints/Constitution level

in your DeclarePlayers.

Er1k

2012-04-01 11:54:50

From: Imagine
It helps if you have:

Level[SKILL_HITPOINTS] := 99; //Change 99 to your MAX Hitpoints/Constitution level

in your DeclarePlayers.


IIRC HPPercent will try to get your HP level first if you didn't do the above. So hardcoding your HP level in the script actually helps, unless you're really training HP big time.

begginer

2012-04-09 04:34:25

Fixed it. Thanks to all helpers