PDA

View Full Version : GLX_GetHPPercent [RS3]



DemiseScythe
07-26-2013, 08:55 PM
I updated the functions and they are now 100% accurate and effective. This method works regardless of screen position.

function GLXLoggedIn: Boolean;
begin
Result := Length(glGetTextures(63697, 3220517, 5));
end;

function GLXGetHP: Integer;
var
H: glTextureArray;
F: glCharArray;
S: glTextArray;
T: TStringArray
begin
if not GLXLoggedIn then
Exit;
H := glGetTextures(63697, 3220517, 5);
F := glGetChars(IntToBox(H[0].X+30, H[0].Y-15, H[0].X+115, H[0].Y+15));
S := glCharsToTextAdv(F);
ExplodeWrap('/', S[0].Text[0], T);
Result := StrToInt(T[0]);
end;

function GLXGetHPPercent: Integer;
var
H: glTextureArray;
F: glCharArray;
S: glTextArray;
T: TStringArray
begin
if not GLXLoggedIn then
Exit;
H := glGetTextures(63697, 3220517, 5);
F := glGetChars(IntToBox(H[0].X+30, H[0].Y-15, H[0].X+115, H[0].Y+15));
S := glCharsToTextAdv(F);
ExplodeWrap('/', S[0].Text[0], T);
Result := Round((StrToInt(T[0])*100) div StrToInt(T[1]));
end;

I will record and upload an updated video tomorrow. This works regardless of the position of the Stat bar on the screen as long as it is horizontal(either the long or the fat version). Summoning and Prayer are just a matter of changing one integer. To show this I'll code both of the above functions for prayer in a second or two.

function GLXGetPrayer: Integer;
var
H: glTextureArray;
F: glCharArray;
S: glTextArray;
T: TStringArray
begin
if not GLXLoggedIn then
Exit;
H := glGetTextures(63697, 3025729, 5);
F := glGetChars(IntToBox(H[0].X+30, H[0].Y-15, H[0].X+115, H[0].Y+15));
S := glCharsToTextAdv(F);
ExplodeWrap('/', S[0].Text[0], T);
Result := StrToInt(T[0]);
end;

function GLXGetPrayerPercent: Integer;
var
H: glTextureArray;
F: glCharArray;
S: glTextArray;
T: TStringArray
begin
if not GLXLoggedIn then
Exit;
H := glGetTextures(63697, 3025729, 5);
F := glGetChars(IntToBox(H[0].X+30, H[0].Y-15, H[0].X+115, H[0].Y+15));
S := glCharsToTextAdv(F);
ExplodeWrap('/', S[0].Text[0], T);
Result := Round((StrToInt(T[0])*100) div StrToInt(T[1]));
end;

http://www.youtube.com/watch?v=wGnrkV16Fog

It is a bit annoying how the new function rounds to the nearest 10% but it still works. Shame it will not be used in any of the includes.

This shouldn't be too hard to convert into color.

YoHoJo
07-26-2013, 09:04 PM
Nice work, video was nice.

serajin
07-26-2013, 09:10 PM
Very cool stuff. Nice job.

The Mayor
07-26-2013, 10:43 PM
Nice, looks very accurate :)

Rich
07-27-2013, 05:42 PM
Very nice work. Definitely needs implementing IMO. +Rep

DrChill
07-27-2013, 06:03 PM
Can't wait until the OpenGL wrapper is ported to Linux :o

<3 The wrapper idea, and I hope SRL6 has a massive OGL wrapper library.

DemiseScythe
07-27-2013, 06:39 PM
Can't wait until the OpenGL wrapper is ported to Linux :o

<3 The wrapper idea, and I hope SRL6 has a massive OGL wrapper library.

SRL6 will not use OGL but it doesnt mean you cant

DrChill
07-27-2013, 07:13 PM
So there's no plan to have any OGL wrapper functions, or is it something we're planning in the future ...?

DemiseScythe
07-27-2013, 09:16 PM
OGL has an include of its own, I just wish @Brandon would share it with me =\

Kasi
07-27-2013, 09:28 PM
OGL has an include of its own, I just wish @Brandon would share it with me =\

last time i checked he was working on text functions. I think a version is on his github.

DemiseScythe
07-28-2013, 03:00 AM
Updated my function now that Brandon has finished the text functions, it works amazing now.

rj
07-28-2013, 04:11 AM
nice (always like seeing you upload vids to see these in action)