Results 1 to 8 of 8

Thread: GetHPPercentageMM

  1. #1
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default GetHPPercentageMM

    My newest creation, this will get the percentage HP you have left without ANY tabswitching
    It uses the circle next to the MM to determine the percentage left. Due to the size of the circle, this is only like 8% accurate.
    SCAR Code:
    {*******************************************************************************
    function GetHPPercentageMM : integer;
    by: Markus
    Description: Gets the HP percentage from the circle next to the MM. Up to 8% accurate
    *******************************************************************************}

    function GetHPPercentageMM : integer;
    var
      i, x, y : integer;
    begin
      for i := 180 downto 0 do
      begin
        x :=round( 13 * Sin(i/180*pi) + 706);
        y :=round( -13*cos(i/180*pi)+27);
        if not(similarcolors(getcolor(x, y), 132231, 70)) then
        begin
          result := (100-round(i div 180.0 * 100));
          break;
        end;
      end;
    end;
    Please tell me how it works

    Markus
    I made a new script, check it out!.

  2. #2
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    thats some nice math.. But i think getting the text is just easier :P

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  3. #3
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    With the text you can't calculate a percentage without gametab switching
    I made a new script, check it out!.

  4. #4
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    With the text you can't calculate a percentage without gametab switching
    Requires only 1 switch per login...i have it search for the total HP and then it will be constant the entire login, and it can check the minimap the rest of the time

    Good function anyway though, i will test it out when i get outa school
    METAL HEAD FOR LIFE!!!

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Markus, why did you revert sine and cosine?

    Cosine gives the "x amount" to go to get to the arc of the unit circle

    Sine is the y thing of the above.

    So,
    X := Round(13 * Cos(i / 180 * Pi)) + 706;
    Y := Round(13 * Sin(i / 180 * Pi)) + 27;

    also, I hope you know that unit circle 0 is the 90 of the general understanding

    So, if you want to go from 180 DownTo 0 from South to North, you need to do

    "(i - 90) / 180 * Pi"

  6. #6
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    For your interest, scar doesn't work in all functions with the 0 = 90 scale, but with the 0 = 0 (north) scale for sin and cos. Arctan does return in the mathematical scale.
    And as scar's Sin and Cos use the normal scale, I am allowed to reverse the Sine and Cosine
    I made a new script, check it out!.

  7. #7
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    For your knowledge mister, if you do the trick with Cos(90) and Sin(90), it'll go to "180"

    And yes, you are allowed to, but, you can also save time by not typing the "-"

  8. #8
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    And yes, you are allowed to, but, you can also save time by not typing the "-"
    In maths, higher Y is going up. In computers it is the opposite, that is were the - comes from
    I made a new script, check it out!.

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
  •