Results 1 to 6 of 6

Thread: MainScreen HP Detection!

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

    Default MainScreen HP Detection!

    I know YoHoJo has made this once, but I wanted to make one my way.

    I hope there is none in SRL, atleast I haven't seen one.

    Works, but sometimes the "hit splats" may come in the way which gives false results.


    You are free to use as long as you credit me.

    Enjoy

    SCAR Code:
    Function GetHealthPoints: TPointArray;
    Var
      BarPoints: Array of TPointArray;
      Green, Red, TPA: TPointArray;
      Place, X, Y, I: Integer;
      Dists: TIntegerArray;
    Begin
      FindColorsTolerance(Green, 65280, MSX1, MSY1, MSX2, MSY2, 0);
      FindColorsTolerance(Red, 255, MSX1, MSY1, MSX2, MSY2, 0);
      TPA := CombineTPA(Green, Red);
      BarPoints := SplitTPAEx(TPA, 50, 15);
      SetArrayLength(Dists, GetArrayLength(BarPoints));
      For I := 0 To High(BarPoints) Do
      Begin
        MiddleTPAEx(BarPoints[i], X, Y);
        Dists[i] := Distance(MSCX, MSCY, X, Y);
      End;
      InIntArrayEx(Dists, Place, AMin(Dists));
      Result := BarPoints[Place];
    End;

    Function HealthPercent: Integer;
    Var
      Green, Red, I: Integer;
      HPts: TPointArray;
    Begin
       HPts := GetHealthPoints;
       For I := 0 To High(HPts) Do
         Case GetColor(HPts[i].x, HPts[i].y) Of
           255: Red := Red + 1;
           65280: Green := Green + 1;
         End;
       Result := Round(Green / 150 * 100);
    End;

  2. #2
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    I made this, too... Quite a while ago.. Together with GetDamageIn..



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    I have had a great idea all day which i might fullfill now ..

    Based on wizzups GetDamage and possibly a few of nesses functions..

    edit wizzup i cant seem to find it possible for u to PM it or post.. xP

    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!

  4. #4
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol I've made something similar. To no surprise, you have done yours with TPointArrays :P Mine would get the HP percent of a HPbar within 2 tiles of where your char was, and it would not read your own. I never got around to posting it, because I found it pretty much useless...

    -Knives

  5. #5
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default




    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Im glad thats five months ago, Wizzy now yours is propably faster than before since those functions are in the plugin of yours

    Yes, TPAs FTW!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MainScreen shift?
    By kingarabian in forum RS has been updated.
    Replies: 4
    Last Post: 04-13-2008, 09:16 PM
  2. turning the mainscreen
    By legendaryhero90 in forum OSR Help
    Replies: 5
    Last Post: 02-21-2007, 12:38 AM

Posting Permissions

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