Results 1 to 9 of 9

Thread: Health points

  1. #1
    Join Date
    Mar 2013
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default Health points

    Hi, is there a method or function that gets the players current hp or hp percentage or something like that.

    cheers

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    GetMMLevels('hp', {var} color) gets the Hp at the MM icon, then use your max hp to calculate the percent. Alternatively get the hp percent from the combat tab (hover over the hp bar), or calculate it based on the amount of green pixels on the bar.

  3. #3
    Join Date
    Mar 2013
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    GetMMLevels works for 07?

  4. #4
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    GetMMLevels('hp', {var} color) gets the Hp at the MM icon, then use your max hp to calculate the percent. Alternatively get the hp percent from the combat tab (hover over the hp bar), or calculate it based on the amount of green pixels on the bar.
    That will only work for EoC, He want's this in OSR.

    Forum account issues? Please send me a PM

  5. #5
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    You may have to change the coords around a little bit:

    Simba Code:
    Program testP06;
    {$I SRL/SRL.Simba}
    {$I SRL/SRL/Misc/Debug.Simba}
    {$I P07Include.Simba}
    Const
      YourHealth = 10;
    var
      GreenP,RedP,MyHP:Integer;
      Health,HealthPercent,AllP,HpPercentMissing,Missing_Health:Extended;
      PercentHP:Extended;
    Procedure ShowHealth;
    Begin
      if (RedP < 1) or (GreenP < 1) Then
      Begin
        Exit;
      End;
      AllP := (RedP + GreenP);
      HpPercentMissing := (RedP/AllP);
      Missing_Health := (MyHP*HpPercentMissing);
      Health := ((MyHp) - (Missing_Health));
      PercentHP := ((RedP/AllP)*100);
      Writeln('I have about ' + ToStr(Health)+ ' HP left');
      Writeln('Percent:' + ToStr(PercentHP));
    End;
    Procedure WriteColors;
    Begin
      Writeln('Green:' + IntToStr(GreenP));
      Writeln('Red:' + IntToStr(RedP));
    End;
    Procedure CountColors;
    Begin
      GreenP := CountColorTolerance(65280,245,140,281,154,3);
      RedP := CountColorTolerance(255,245,140,281,154,3);
    End;
    Begin
      SetupP07Include;
      ActivateClient;
      Wait(500);
      P06_MakeCompassNorth;
      P07_MakeCameraAngleHigh;
      MyHP := YourHealth;
      CountColors;
      WriteColors;
      ShowHealth;
    End.

  6. #6
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    There is a function called HPPercent in SRL-OSR...
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  7. #7
    Join Date
    Nov 2011
    Posts
    335
    Mentioned
    0 Post(s)
    Quoted
    68 Post(s)

    Default

    Quote Originally Posted by litoris View Post
    There is a function called HPPercent in SRL-OSR...
    Cant find it in the include 0_o ... Or am I looking form the wrong place?

  8. #8
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Quote Originally Posted by l6bustank View Post
    Cant find it in the include 0_o ... Or am I looking form the wrong place?
    Do you have SRL-OSR? If you do, including it at the top and then searching for it on the left frame should work.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  9. #9
    Join Date
    Nov 2011
    Posts
    335
    Mentioned
    0 Post(s)
    Quoted
    68 Post(s)

    Default

    Quote Originally Posted by litoris View Post
    Do you have SRL-OSR? If you do, including it at the top and then searching for it on the left frame should work.
    under SRL-OSR do you mean the unofficial 07-include or is there sth else I dont know about?

    E: Downloaded the include from Github and also placed the fonts uploaded here: http://villavu.com/forum/showthread.php?t=98324 to C:/Simba/Fonts, but... I still get this error:
    Simba Code:
    [Error] C:\Simba\Includes\SRL-OSR/SRL/core/text.simba(805:13): Unknown identifier 'UpChars07' at line 804

    What should I do about it?
    Last edited by l6bustank; 03-17-2013 at 02:00 PM.

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
  •