Simba Code:
// fill out const's
Program autofight;
{$i srl/srl.simba}
const
NPC = 1121869;
loot = 14079706;
tolerence = 12;
time = 1; // in seconds
rwait = 1000;
tleft = 41;
tright = 44;
bleft = 426;
bright = 280;
var
charm: Integer;
Skeleton:TPoint;
procedure PickUp;
var
X, Y: Integer;
begin
Wait(500 + Random(1200));
WriteLn('Looking for bones...');
if FindColorTolerance(X, Y, loot, 223, 114, 388, 290, 15) then
begin
WriteLn('Found bones!');
MouseSpeed:=40;
mmouse(x, y,1,1);
Wait(120 + Random(80));
ClickMouse(x, y, mouse_Right);
WriteLn('Looking for charm...');
Wait(1100);
FindBitmapToleranceIn(charm, X, Y,161, 86, 420, 252, 95)
MouseSpeed:=40;
mmouse(x, y,1,1);
WriteLn('Found charm!');
Wait(500);
ClickMouse(X, Y, mouse_Left);
Wait(1820 + Random(80));
end;
end;
procedure CheckCombat;
var
X, Y: Integer;
begin
if FindColorTolerance(X, Y,49499,241, 115, 291, 179, 17) then
begin
Wait(700 + Random(250));
WriteLn('Waiting to get out of combat . . .');
CheckCombat;
end;
Pickup
end;
procedure ClickNPC;
var
X, Y: Integer;
begin // kill npc
WriteLn('Attacking skeleton...');
if FindColorTolerance(X, Y, NPC, tleft, tright, bleft, bright, tolerence) then
begin
MouseSpeed:=25;
mmouse(x, y,1,1);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
WriteLn('Attacked skeleton!');
Wait(3000 + Random(150));
CheckCombat;
end;
end;
begin
charm := BitmapFromString(44, 12, 'meJzFU9sNgCAMZBD+/XAJR/THXZ' +
'jAtdTYpClH2xQJkfSDXvo4zjMva/4j0ns+t2/7xREsjuNxAvSKyBy' +
'uD+JdBIKSzuMw3iLxo5yMP3cOf6DqB9UnLQdZRjiLSasptWhAo1xn' +
'+QQ4wCt4lBQB+PjCyrTrDhzUD8GCTOJg+UGudtxu6TzIAWj4tmxNB' +
'bIArkoHnsz1P57qY9GwalRcTWXZDd+RiMw=');
repeat
ClearDebug;
ClickNPC;
until False;
FreeBitmap(charm);
end.