Markus
02-11-2008, 03:01 PM
My newest creation, this will get the percentage HP you have left without ANY tabswitching :D
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.
{************************************************* ******************************
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
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.
{************************************************* ******************************
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