Turpinator
2013-12-10 02:34:52
Simple and effective.
HP
ADRLN
Prayer
Summoning
Grabs 0,0 of action bar, uses static coords of the HP bar to check for the background color. Once it is not found, it exits and returns the number of pixels left (hp bar is 100 pixels long, so that nice. ;))
made for @The Mayor because @Sjoe's was slower and processed 300-400 pixels, and this processes 100 at max, with the actual number being 100-hp percent.
edit: added the others and switched it to an object func. so usage is still as simple as
HP
function TRSActionBar.getHPPercent: integer;
var
xx, yy: Integer;
begin
xx := self.X1 + 46;
yy := self.Y1 + 23;
for result := 100 downto 1 do
if getColor(xx + result, yy) <> 2894115 then
break;
end;ADRLN
function TRSActionBar.getAdrenalinePercent: integer;
var
xx, yy: Integer;
begin
xx := self.X1 + 185;
yy := self.Y1 + 23;
for result := 100 downto 1 do
if getColor(xx + result, yy) <> 2894115 then
break;
end;Prayer
function TRSActionBar.getPrayerPercent: integer;
var
xx, yy: Integer;
begin
xx := self.X1 + 324;
yy := self.Y1 + 23;
for result := 100 downto 1 do
if getColor(xx + result, yy) <> 2894115 then
break;
end;Summoning
function TRSActionBar.getSummoningPercent: integer;
var
xx, yy: Integer;
begin
xx := self.X1 + 463;
yy := self.Y1 + 23;
for result := 100 downto 1 do
if getColor(xx + result, yy) <> 2894115 then
break;
end;Grabs 0,0 of action bar, uses static coords of the HP bar to check for the background color. Once it is not found, it exits and returns the number of pixels left (hp bar is 100 pixels long, so that nice. ;))
made for @The Mayor because @Sjoe's was slower and processed 300-400 pixels, and this processes 100 at max, with the actual number being 100-hp percent.
edit: added the others and switched it to an object func. so usage is still as simple as
actionBar.getHPPercent
