Simba Code:
program TAs_Teak_To_CastleWars_BankScript;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i sps/lib/sps-rs3.simba}
var
loadsDone: Integer;
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := '';
password := '';
isActive := true;
isMember := true;
end;
currentPlayer := 0;
end;
procedure findDepositBox();
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit;
repeat
mainscreen.findObject(x, y, 724754, 1, colorSetting(2, 2.39, 2.71), mainscreen.playerPoint, 30, 50, 50, ['ank', 'chest'], MOUSE_LEFT);
wait(randomRange(1000, 2000));
inc(i);
until depositBox.isOpen() or (i >= 15);
end;
procedure depositlogs();
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(randomrange(1000, 2000));
end;
until (depositBox.isEmpty()) or (not isLoggedIn()) or (bankTimer.getTime() > 10000);
end;
depositBox.close();
end;
procedure runToTree();
var
pathToTree: TPointArray;
begin
if not isLoggedIn() then
exit();
pathToTree :=[Point(520, 107), Point(523, 114), Point(517, 98), Point(517, 89), Point(549, 89), Point(588, 92), Point(598, 97), Point(591, 133), Point(579, 156), Point(568, 169), Point(543, 189), Point(519, 205), Point(477, 220), Point(422, 225), Point(370, 229), Point(333, 223), Point(288, 228), Point(241, 230), Point(188, 232), Point(145, 233), Point(108, 231), Point(91, 232)]
if SPS.walkPath(pathToTree) then
minimap.waitPlayerMoving()
else
writeLn('We failed to walk to the Tree');
end;
procedure chopTeak();
var
x, y, i: integer;
mineTimer: TTimeMarker;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit();
mineTimer.start();
repeat
findColorsSpiralTolerance(x, y, TPA, 999465, mainScreen.getBounds(), 7, colorSetting(2, 0.17, 0.41));
if (length(TPA) < 1) then
exit();
ATPA := TPA.toATPA(30, 30);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['Teak', 'eak'], 500) then
begin
fastClick(MOUSE_LEFT);
smartImage.clear();
break();
wait(randomrange(1000, 5000));
end;
end;
tabBackpack.waitForShift(5000);
claimSpinTicket();
until tabBackpack.isFull() or (mineTimer.getTime() > 300000);
end;
procedure runToBank();
var
pathToBank: TPointArray;
begin
if not isLoggedIn() then
exit();
pathToBank :=[Point(79, 243), Point(113, 234), Point(167, 226), Point(209, 226), Point(253, 232), Point(282, 230), Point(326, 223), Point(356, 226), Point(388, 222), Point(435, 219), Point(467, 219), Point(504, 215), Point(538, 202), Point(566, 180), Point(590, 153), Point(608, 123), Point(605, 94), Point(588, 91), Point(522, 92), Point(514, 103), Point(533, 133)]
if SPS.walkPath(pathToBank) then
minimap.waitPlayerMoving()
else
writeLn('We failed to walk to the Bank');
end;
begin
clearDebug();
smartEnableDrawing := true;
disableSRLDebug := false;
setupSRL();
declarePlayers();
SPS.setup('Teak_Map1', RUNESCAPE_OTHER);
if not isLoggedIn() then
begin
players[currentPlayer].login();
exitSquealOfFortune();
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_NORTH);
end;
if tabBackpack.isFull() then
begin
runToBank();
findDepositBox();
depositlogs();
end;
runToTree();
chopTeak();
runToBank();
findDepositBox();
depositLogs();
end.