Pew
2012-12-25 02:21:35
Pretty much I'm trying to make a bot that will click on the master farmer until it detects that the hp bar is at a certain % then eat some food.
This script ran fine when using until a certain number of clicks but when I tried to change the until it detects red (255) at a certain spot it doesn't work. I'm sure there are many other ways to go about this but I only started trying to code yesterday.
This is a 2006 remake so it doesn't have hp displayed on the minimap only in stats and the preset commands in library are mostly too updated and do not work.
Any insight at all it greatly appreciated.
This script ran fine when using until a certain number of clicks but when I tried to change the until it detects red (255) at a certain spot it doesn't work. I'm sure there are many other ways to go about this but I only started trying to code yesterday.
This is a 2006 remake so it doesn't have hp displayed on the minimap only in stats and the preset commands in library are mostly too updated and do not work.
Any insight at all it greatly appreciated.
//Start South of master farmer facing North with camera highest.
program new;
{$define srl5}
{$i srl/srl.simba}
var
x, y, i, o: Integer;
procedure Thieve;
var
numberOfWaits: Integer;
begin
repeat
If FindColorTolerance(x, y, 8620429, 242, 115, 283, 151, 5) then
begin
Mouse(x, y, 4, 4, true);
end else
begin
WriteLn('Farmer not found!');
end;
Wait(10 + Random(1500));
Inc(numberOfWaits); // The Inc() command simply increases the var numberOfWaits by 1
WriteLn('We have waited ' + IntToStr(numberOfWaits) + ' times');
until(FindcolorTolerance(i, o, 255, 270, 146, 271, 148, 1));
end;
begin
SetUpSRL;
Thieve;
end.