Results 1 to 7 of 7

Thread: If hp lower than 30% do sth

  1. #1
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default If hp lower than 30% do sth

    Tittle. How can I do that?
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  2. #2
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Simba Code:
    if HPPercent > 30 then

  3. #3
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Not working. Tried like 10 times
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  4. #4
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Hmmm, you must be doing something wrong then

    Here's the definition for the function, make sure you're using it correctly:
    Simba Code:
    (*
    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
    *)

  5. #5
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It helps if you have:

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

    in your DeclarePlayers.

  6. #6
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Imagine View Post
    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.
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  7. #7
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Fixed it. Thanks to all helpers
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •