Results 1 to 11 of 11

Thread: If hp<xx

  1. #1
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default If hp<xx

    Is there a function that reads your hp? like
    (If hp is lower than 30);
    Logout;

    ?
    Oh Hai Dar

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    search in Gametab.scar

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #3
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Use GetMMLevels to get the HP from the side of the minimap. Then just check if your HP is less than your set amount.

    EDIT: Which is in GameTab.scar

  4. #4
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    I am not very good at scar, so could you guys explain more?
    If I want to Log out when hp is red (or a digit) in my script, what do I add?


    I know I should call the GetAllLevels;, but what do I do after?
    Oh Hai Dar

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    GetMMLevels;
    If(HPPercent < 35) then
    RunFromFight;
    LogOut;

    something like that?

  6. #6
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    Function GetMMLevels(LevelType : String;var ColorSign : String): integer;
    By: Raymond / Wizzup
    Description: Returns the level shown next to the minimap.
    Colorsign returns the color of the text (Green,Yellow,Orange,Red).
    Returns -1 if failed.
    *******************************************************************************}

    You can use that function to 1. return the player's hp and 2. return the colour of the hp text. You can go about this in two ways:

    1. If you just want to log out when the HP Text is red something like this should do:
    SCAR Code:
    procedure LogOutWhenRed;
    var
      TextColour: string;
    begin
      GetMMLevels('hp', TextColour);
      if (TextColor = 'Red') then
        LogOut;
    end;

    2. Use GetMMLevels to check your HP as an amount:
    SCAR Code:
    procedure LogOutWhenHPLow;
    var
      TextColour: string;
    begin
      if (GetMMLevels('hp', TextColour) < {SomeHPNumberHere}) then
        LogOut;
    end;

    You can also use HPPercent to return the percent of HP the player has left.

  7. #7
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Thanks!
    I have couple more question:
    #1 is the a procedure to check if it already prayed?(I'll check pray.scar)
    EDIT: I don't really understand how to setup GetPrayerCoords, could some one use it in a sample script?
    #2 is there a procedure that will allow the scar to ENABLE/ Disable smart it self?
    Oh Hai Dar

  8. #8
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by M_A_I_N_FTW View Post
    Thanks!
    I have couple more question:
    #1 is the a procedure to check if it already prayed?(I'll check pray.scar)
    EDIT: I don't really understand how to setup GetPrayerCoords, could some one use it in a sample script?
    #2 is there a procedure that will allow the scar to ENABLE/ Disable smart it self?
    1.
    a.
    SCAR Code:
    {*******************************************************************************
    function PrayerActivated(Name: string): Boolean;
    By: Nielsie95
    Description: Returns true if the prayer is activated.
    *******************************************************************************}

    That function checks if a particular prayer is activated.
    b. GetPrayerCoords stores the colour of a particular prayer and the coordinates of the box the prayer is in. Its used by the other prayer functions not necessarily needed directly by the scripter.

    2. I tried looking for a procedure like that but I don't think SMART has one. Theres one to enable/disable the graphics and the debug and adjust the FPS rate though.

  9. #9
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    I'll try to mess around the prayer thing more, and LOL at the smart.

    When the arrow goes up (on smart) fps goes higher or lower?


    Also, my script execut it self at times..(not really MY SCRIPT) It doesn't had any error, it just executed it self..
    Oh Hai Dar

  10. #10
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    I'd guess higher.
    Ce ne sont que des gueux


  11. #11
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    k
    Oh Hai Dar

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
  •