Simba Code:
program vinylcowkiller;
{$DEFINE SRL_USE_REMOTEINPUT}
{$i srl/osr.simba}
{add settings for ranged attacking (arrow count, switching when out of arrows, etc)}
{add failsafe, if we are gaining exp then we're okay, if exp has not been gained recently then log out}
var
wrld: TIntegerArray;
timer: TStopwatch;
RSW: TRSWalker;
userr, passs, pinn: string;
procedure declareplayer;
begin
userr:= ''; //username
Passs:= ''; //password
Pinn:= ''; //bank pin
//wrld:= [-1]; //worlds you want. put commas between them. (-1 is random)
login.AddPlayer(userr, passs, pinn);
end;
procedure setup;
begin
if not rsclient.IsLoggedIn then
exit;
declareplayer;
begin
rsw.Setup('world');
options.SetZoomLevel(30);
minimap.SetCompassAngle(270);
end;
end;
procedure dobank;
var
x, y: integer;
begin
if not inventory.isfull then
begin
writeln('still have room in inventory');
exit;
end;
begin
writeln('walking to al kharid gate');
rsw.WalkPath([[4834, 3343], [4827, 3381], [4811, 3418], [4825, 3452], [4847, 3497], [4875, 3538]]);
if findcolor(x, y, 5997527, mainscreen.Bounds) then
//need to only select guards on the same side of the gate as you
begin
mouse.move(x, y);
wait(100);
if mainscreen.IsUpText('Talk-to Border Guard', 100) then
begin
mouse.click(mouse_right);
wait(50);
if chooseoption.IsOpen then
begin
chooseoption.Select('Talk-to Border Guard', mouse_left, false, true);
//need to do case..of and randomly choose between clicking gate and clickng guard
end;
end;
end;
end;
end;
procedure grabhides;
var
hide, TPA: TPointArray;
ATPA: T2DPointArray;
begin
if inventory.IsFull then
begin
Writeln('inventory is full, banking');
dobank;
end;
if srl.findcolors(TPA, CTS2(12303300, 4, 0.31, 0.15), mainscreen.bounds) then
begin
writeln('looking for hides...');
ATPA := TPA.Cluster(2);
writeln('clustering TPAs into ATPA');
ATPA.FilterSize(25, 300);
writeln('filtering ATPAs');
ATPA.SortByIndex(Mainscreen.Center);
writeln('finding matching TPAs');
for hide in ATPA do
begin
writeln('hides detected');
mouse.move(hide[random(length(hide))]);
if mainscreen.IsUpText('Take', 50) then
begin
mouse.click(mouse_left);
writeln('grabbing cowhide');
repeat
writeln('still grabbing');
wait(randomrange(100, 176));
until(not(srl.IsAnimating(box(248, 151, 266, 182), 125, 1000, 3)));
exit;
end;
end;
end;
end;
procedure timerun;
begin
writeln(srl.MsToTime(gettimerunning, time_short));
end;
procedure antibanstuff;
begin
end;
procedure Getskillups;
begin
end;
function iscowfought(boxxy: TBox): boolean;
begin
result:= true;
end;
function unreachable: boolean;
begin
if chat.GetMessage(1) = 'I can''t reach that!' then
Result:= true;
end;
procedure attackcow;
var
x, y: integer;
cow, TPA: TPointArray;
ATPA: T2DPointArray;
begin
{if inventory.IsFull then
begin
writeln('inventory is full');
//dobank;
end; }
writeln('looking for cows..');
if srl.findcolors(TPA, CTS2(5201264, 19, 0.08, 0.33), mainscreen.bounds) then
begin
ATPA := TPA.Cluster(2);
writeln('clustering TPAs into ATPA');
ATPA.FilterSize(100, 500);
writeln('filtering ATPAs');
ATPA.SortByIndex(Mainscreen.Center);
writeln('finding matching TPAs');
timer.Start;
for cow in ATPA do
begin
if timer.ElapsedTime > 2500 then
begin
minimap.SetCompassAngle(randomrange(0, 359), 10);
end;
writeln('potential cow!');
writeln(timer.elapsedtime);
mouse.move(cow[random(length(cow))]);
if mainscreen.IsUpText('Attack Cow', 50) then
begin
mouse.click(mouse_left);
if mainscreen.DidRedClick then
begin
wait(randomrange(600, 1500));
if Chat.FindMessage('I can''t reach that!', [CHAT_COLOR_BLACK]) then
begin
writeln('Unreachable cow, adjusting angle and looking again');
Minimap.SetCompassAngle(Randomrange(1, 358), 10);
end else
begin
writeln('attacking');
repeat
writeln('still attacking');
wait(randomrange(100, 176));
until(not(srl.IsAnimating(box(248, 151, 266, 182), 150, 1000, 3)));
timer.Reset;
Exit;
{begin
writeln('cow is dead, grabbing hide');
wait(randomrange(1000, 2000));
grabhides;
end;}
end;
end;
timerun;
end;
end else
begin
minimap.SetCompassAngle(randomrange(0, 359), 10);
end;
end;
end;
begin
cleardebug;
setup;
repeat
{if not rsclient.IsLoggedIn then
begin
declareplayer;
writeln('logging in...');
login.LoginPlayer;
Writeln('You aren''t logged in');
exit;
end else }
begin
repeat
writeln(srl.MsToTime(gettimerunning, time_short));
attackcow;
until(not(rsclient.IsLoggedIn));
end;
until((gettimerunning >= 14400000) and (rsclient.IsLoggedIn = false));
end.