Simba Code:
program tWillows;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'UN';
password := 'PW';
isActive := true;
isMember := false;
end
currentPlayer := 0;
end;
procedure runToWillows();
var
pathToWillows: TPointArray;
begin
if not isLoggedIn() then
exit;
pathToWillows := [Point(197, 181), Point(179, 183), Point(167,163), Point(171, 138), Point(194, 134), Point(217, 125), Point(235,112), Point(254,100)];
if SPS.walkPath(pathToWillows) then
minimap.waitPlayerMoving()
else
writeLn('We failed to walk to the Willows');
end;
procedure clickWillowTree();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit;
findColorsSpiralTolerance(x, y, TPA, 1582627, mainScreen.getBounds(), 3, colorSetting(2, 0.67, 0.41));
if (Length(TPA) < 1) then
exit;
ATPA := TPA.toATPA(30, 30);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['illow'], 500) then
begin
repeat
fastClick(MOUSE_LEFT);
wait(10000);
until tabBackPack.isFull();
end;
end;
end;
procedure runToDepositBox();
var
pathToDepositBox: TPointArray;
begin
if not isLoggedIn() then
exit;
pathToDepositBox := [Point(254, 100), Point(235, 112), Point(217,125), Point(194, 134), Point(171, 138), Point(167, 163), Point(179,183), Point(197,181)];
if SPS.walkPath(pathToDepositBox) then
minimap.waitPlayerMoving()
else
writeLn('We failed to walk to the Deposit Box');
end;
procedure findDepositBox();
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit;
repeat
mainscreen.findObject(x, y, 4084066, 7, colorSetting(2, 0.06, 0.19), mainscreen.playerPoint, 30, 50, 50, ['eposit', 'box'], MOUSE_LEFT);
wait(randomRange(1000, 2000));
inc(i);
until depositBox.isOpen() or (i >= 15);
end;
procedure depositWillows();
var
bankTimer: TTimeMarker;
begin
if not isLoggedIn() then
exit;
if depositBox.isOpen() then
begin
bankTimer.start();
repeat
if (depositBox.count > 0) then
begin
depositBox.quickDeposit(QUICK_DEPOSITBOX_INVENTORY);
wait(gaussRangeInt(500, 750));
end;
until(depositBox.isEmpty()) or (not isLoggedIn()) or (bankTimer.getTime() > 10000);
end;
depositBox.close();
end;
{Main Loop}
begin
clearDebug();
smartEnableDrawing := true;
setupSRL();
declarePlayers();
SPS.setup('SarimWillows', RUNESCAPE_OTHER); // Setup our map
if not isLoggedIn() then
begin
players[currentPlayer].login();
exitTreasure();
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_NORTH);
end;
repeat
runToWillows();
repeat
clickWillowTree();
until tabBackPack.isFull();
runToDepositBox();
findDepositBox();
depositWillows();
until false;
end.