SRL Archive - SRL Snippets

GLX_GetHPPercent [RS3]


DemiseScythe

2013-07-26 16:55:09

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

2013-07-26 17:04:13

Nice work, video was nice.

serajin

2013-07-26 17:10:46

Very cool stuff. Nice job.

The Mayor

2013-07-26 18:43:53

Nice, looks very accurate :)

Rich

2013-07-27 13:42:40

Very nice work. Definitely needs implementing IMO. +Rep

DrChill

2013-07-27 14:03:04

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

2013-07-27 14:39:09

From: DrChill
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

2013-07-27 15:13:01

So there's no plan to have any OGL wrapper functions, or is it something we're planning in the future …?

DemiseScythe

2013-07-27 17:16:06

OGL has an include of its own, I just wish @Brandon would share it with me =\

Kasi

2013-07-27 17:28:31

From: DemiseScythe
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

2013-07-27 23:00:09

Updated my function now that Brandon has finished the text functions, it works amazing now.

rj

2013-07-28 00:11:37

nice (always like seeing you upload vids to see these in action)