View Full Version : (Request) How to make an Eating function
I need some procedure to Check my health every now and then, and when it below lets say.. 50%? it finds the edible food in the inventory and eats it.
could some help me out and tell me a method of doing this?
shadowmarkus
01-16-2012, 06:15 AM
procedure HpCheck;
var
a, t, b, x, y:Integer;
begin
if (HPPercent < 50) and LoggedIn then
begin
if not InvEmpty then
for a := 0 to 2 do
for b := 1 to 28 do
if ExistsItem(b) then
begin
MMouseItem(b);
GetMousePos(x, y);
if WaitUptext('Eat', 400) then
begin
Mouse(x,y,0,0,false);
if WaitOption('Eat', 400) then
begin
t := GetSystemTime;
while ExistsItem(b) and ((GetSystemTime-t) < 2000) do
wait(20);
if (HPPercent > 70) then
Exit;
end;
end;
end;
if (not LoggedIn) or (HPPercent > 50) then
Exit;
end;
end;
Credit to Narcle for the method.
procedure HpCheck;
var
a, t, b, x, y:Integer;
begin
if (HPPercent < 50) and LoggedIn then
begin
if not InvEmpty then
for a := 0 to 2 do
for b := 1 to 28 do
if ExistsItem(b) then
begin
MMouseItem(b);
GetMousePos(x, y);
if WaitUptext('Eat', 400) then
begin
Mouse(x,y,0,0,false);
if WaitOption('Eat', 400) then
begin
t := GetSystemTime;
while ExistsItem(b) and ((GetSystemTime-t) < 2000) do
wait(20);
if (HPPercent > 70) then
Exit;
end;
end;
end;
if (not LoggedIn) or (HPPercent > 50) then
Exit;
end;
end;
Credit to Narcle for the method.
Thank you very much.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.