Code:
program scriptTemplate;
{$DEFINE SMART} // Always have this to load smart
{$I SRL-6/SRL.simba} // To load the SRL include files
{$I SPS/lib/SPS-RS3.Simba} // To load the SPS include files
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'USER';
password := 'PASS';
isActive := true;
isMember := false;
end
currentPlayer := 0;
end;
procedure tpToVarrock();
var
p: TPoint;
begin
if not isLoggedIn() Then
exit;
repeat
lodestoneScreen.teleportTo(LOCATION_PORT_SARIM);
wait(randomRange(14500, 16000));
until (not isLoggedIn()) or minimap.findSymbol(p,MM_SYMBOL_SHOP_FISHING, minimap.getBounds());
end;
procedure runToClay
var
pathToMine: TPointArray;
begin
if not isLoggedIn() Then
exit;
pathToMine := [[213, 225], [198, 183], [189, 124], [172, 87], [130, 69], [78, 59], [40, 70], [47, 108], [70, 118], [80, 123]];
if SPS.walkPath(pathToMine) Then
minimap.waitPlayerMoving()
else
writeLn('We failed to walk to the clay');
end;
procedure mineRocks();
var
x, y, i: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
mineTimer: TTimeMarker;
begin
if not isLoggedIn() Then
exit;
mineTimer.start();
repeat
findColorsSpiralTolerance(x, y, TPA, 4298938, mainScreen.getBounds(), 6, colorSetting(2, 0.48, 1.38));
if (Length(TPA) < 1) then
exit;
ATPA := TPA.toATPA(30, 30);
ATPA.filterBetween(0, 10); //I added this line
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['Clay', 'lay'], 500) Then
Begin
fastClick(MOUSE_LEFT);
smartImage.clear;
break;
end;
end;
tabBackpack.waitForShift(5000);
claimSpinTicket();
until tabBackpack.isFull() or (mineTimer.getTime() > 30000);
end;
procedure tpToPortSarim();
var
pathToDepositBox: TPointArray;
p: TPoint;
begin
if not isLoggedIn() Then
exit;
repeat
lodestoneScreen.teleportTo(LOCATION_PORT_SARIM);
wait(randomRange(16000, 19000));
until (not isLoggedIn()) or minimap.findSymbol(p,MM_SYMBOL_SHOP_FISHING, minimap.getBounds());
pathToDepositBox := [[212, 224], [247, 222], [278, 207], [279, 171], [281, 136], [326, 134], [369, 137]];
if SPS.walkPath(pathToDepositBox) Then
minimap.waitPlayerMoving()
else
writeLn('We failed to walk to the deposit box =(');
end;
procedure depositClay();
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;
procedure findDepositBox();
var
x, y, i: Integer;
begin
if not isLoggedIn() Then
exit;
repeat
mainscreen.findObject(x, y, 4411742, 7, colorSetting(2, 0.22, 1.75), mainscreen.playerPoint, 30, 50, 50, ['eposit', 'box'], MOUSE_LEFT); // 4872552, 5, colorSetting(2, 1.50, 0.34)
wait(randomRange(1000, 2500));
inc(i);
until depositBox.isOpen() or (i >= 15);
end;
// main loop
begin
clearDebug(); // Clear the debug box
smartEnableDrawing := true; // So we can draw on SMART
setupSRL(); // Load the SRL include files
declarePlayers(); // Set up your username/pass
//SPS.setup('PORT_SARIM', RUNESCAPE_OTHER); // My SPS Map for Clay
SPS.setup('PORT_SARIM_MAP', RUNESCAPE_OTHER); // My SPS Map for Clay
repeat
if not isLoggedIn() then // If player isn't logged in then
begin
players[currentPlayer].login(); // Log them in
exitTreasure(); // Exit treasure hunter
minimap.setAngle(MM_DIRECTION_NORTH); // Make compass north and angle high
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
if tabBackpack.isFull() then
begin
tpToPortSarim();
findDepositBox();
depositClay();
end;
tpToVarrock();
runToClay();
mineRocks();
until(false);
end.