Timer
2008-10-05 19:51:00
I was taking apart my Auto-Fighter today, i just got bored, so, i thought someone might find this function in interest..
Use:
[Beginning Of Script]
[Use In Script]
function DetectFood(var BitMap: Integer): Boolean;
var
I: Integer;
Item: TBox;
begin
try
FreeBitamp(BitMap);
except
end;//In case its already set before i make one to be used.
for I := 1 to 28 do
begin
MMouseItem(I);
Wait(50 + Random(50));
if (IsUpText('Eat')) then
begin
GetInvItemBounds(I, Item);
BitMap := BitmapFromString(Item.X2 - Item.X1, Item.Y2 - Item.Y1, '');
CopyClientToBitmap(BitMap, Item.X1, Item.Y1, Item.X2, Item.Y2);
Result := True;
Exit;
end;
end;
end;
CREDIT PLEASE!Use:
[Beginning Of Script]
DetectFood(Global_Food_Bitmap_);//Can be used for If, and Then, for if really found or not.. ;)[Use In Script]
if (FindBitmapToleranceIn(Global_Food_Bitmap_, x, y, ..., ..., ..., ..., 30)) then
Mouse(x + 10, y + 10, 3, 3, True);//Edge of food, x and y + 10 so its closer to center of food... ;)