Simba Code:
program clayMining;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
const
loops = 2;
loop = 1;
clayPrice = 406; // put the actual clay price here
var
mineTimer: TTimeMarker;
failedToMine, failSafeCounter, fails, LoadsDone: integer;
procedure declarePlayers();
begin
setLength(players, 1);
with players[currentPlayer] do
begin
loginName := 'ID';
password := 'PW';
isActive := true;
isMember := false;
end
currentPlayer := 0;
end;
procedure afterLogin();
begin
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
procedure failSafe();
var
pathForFailSafe: TPointArray;
begin
writeln('Failsafe startet!');
failSafeCounter = +1;
if not isLoggedIn then
players[currentPlayer].login;
begin
if (players.getActive > 0) then
begin
afterLogin();
end;
begin
Inc(fails);
lodestoneScreen.teleportTo(LOCATION_PORT_SARIM);
WriteLn('found lodestone');
writeLn('waiting for teleporting...');
wait(randomRange(17000,23000));
writeLN('...waited long enough.. now RUN!');
begin
pathForFailSafe := [Point(495, 303), Point(508, 300), Point(521, 301), Point(535, 300), Point(549, 298), Point(559, 297), Point(559, 284), Point(563, 266), Point(561, 254), Point(559, 240), Point(561, 230), Point(564, 229), Point(574, 229), Point(586, 228), Point(602, 228), Point(621, 229), Point(629, 228)];
if SPS.walkPath(pathForFailSafe) Then
begin
minimap.waitPlayerMoving();
writeLN('fail safe was succesfull');
exit;
end else
writeLn('FailSafe failed!');
failSafe;
end;
end;
end;
end;
procedure toMine();
var
pathToBank: TPointArray;
begin
if not isLoggedIn then
players[currentPlayer].login;
begin
afterLogin();
end;
if (players.getActive > 0) then
begin
pathToBank := [Point(634, 227), Point(619, 227), Point(600, 228), Point(581, 228), Point(563, 229), Point(562, 219), Point(561, 205), Point(545, 206), Point(530, 205), Point(506, 206), Point(488, 205), Point(469, 201), Point(435, 200), Point(411, 201), Point(379, 197), Point(370, 197), Point(368, 217)];
if SPS.walkPath(pathToBank) Then
begin
minimap.waitPlayerMoving();
writeln('walked to mine!');
mineTimer.reset();
exit;
end else
writeLn('failed to walk to mine, activating fail safe!');
mineTimer.reset();
failsafe;
exit;
end;
end;
procedure toBank();
var
pathToBank: TPointArray;
begin
if not isLoggedIn then
players[currentPlayer].login;
begin
afterLogin();
end;
if (players.getActive > 0) then
begin
pathToBank := [Point(368, 217), Point(370, 197), Point(379, 197), Point(411, 201), Point(435, 200), Point(469, 201), Point(488, 205), Point(506, 206), Point(530, 205), Point(545, 206), Point(561, 205), Point(562, 219), Point(563, 229), Point(581, 228), Point(600, 228), Point(619, 227), Point(634, 227)];
if SPS.walkPath(pathToBank) Then
begin
minimap.waitPlayerMoving();
writeLn('walked to bank!');
wait(randomRange(700,1700));
exit;
end else
writeLn('failed to walk to bank, activating fail safe!');
failsafe;
exit;
end;
end;
procedure findBankz();
var
slot1Box: TBox;
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn then
players[currentPlayer].login;
begin
if (players.getActive > 0) then
begin
afterLogin();
end;
findColorsSpiralTolerance(x, y, TPA, 4413545, mainScreen.getBounds(), 10, colorSetting(2, 0.05, 0.09));
if (Length(TPA) < 1) then
exit;
ATPA := TPA.toATPA(30, 30);
ATPA.filterBetween(0, 60);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['ank'], 500) then
begin
fastClick(MOUSE_LEFT);
break;
end;
end;
end;
end;
Function antiBan: Boolean;
var
I: integer;
begin
I:= random(500);
Case I of
1..10:
begin
wait(100 + random(500));
end;
20..60:
begin
pickUpMouse;
end;
80..100:
begin
wait(2000+random(1500));
end;
130..150:
begin
mouseMovingObject();
end;
end;
end;
procedure progressReport();
var
clayMined, profit, profitPerHour, clayPerHour: integer;
begin
clayMined := (LoadsDone * 28);
clayPerHour := round((clayMined * 60) / (getTimeRunning() /60000));
profit := (clayMined * clayPrice);
profitPerHour := round((profit * 60) / (getTimeRunning() /60000));
writeLn('Time Running: ' + timeRunning);
writeLn('Clay mined: ' + intToStr(clayMined));
writeLn('Clay/h: ' + intToStr(clayPerHour));
writeLn('Profit made: ' + intToStr(profit));
writeLn('Profit/h: ' + intToStr(profitPerHour));
writeLn('Times failed: ' + intToStr(fails));
end;
procedure findOrez();
var
slot1Box: TBox;
x, y, i, invCount, count: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
failCounter: TTimeMarker;
begin
if not isLoggedIn then
players[currentPlayer].login;
begin
if (players.getActive > 0) then
begin
afterLogin();
end;
count := tabBackPack.count();
if not isLoggedIn() then
exit;
if (tabBackPack.count() = 28) then
exit;
invCount = tabBackPack.count();
count := 0;
repeat
if (count = 5) then
exit;
findColorsSpiralTolerance(x, y, TPA, 9420488, mainScreen.getBounds(), 9, colorSetting(2, 0.39, 1.07))
if (Length(TPA) < 1) then
exit;
ATPA := TPA.toATPA(20, 20);
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(['ine'], 500) then
begin
fastClick(MOUSE_LEFT);
tabBackPack.waitForShift(5000);
break;
end;
end else
begin
failSafe();
findBankz();
bank();
toMine();
exit;
end;
until(tabBackPack.count() = 28) or (not isLoggedIn());
if (count = 5) then
failSafe();
end;
end;
begin
clearDebug();
disableSRLDebug := true;
smartEnableDrawing := true;
setupSRL;
writeLN('SRL setup!');
declarePlayers();
writeLn('Player loaded!');
failSafeCounter := 0;
writeLn('set fail counter to 0');
SPS.setup('clayPorttest', RUNESCAPE_OTHER);
if not isLoggedIn() then
begin
players[currentPlayer].login();
exitSquealOfFortune();
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
mainScreen.setAngle(MS_ANGLE_HIGH);
writeLn('Starting the script. Have fun');
wait(randomRange(500,1500));
repeat
repeat
findOrez();
until (tabBackPack.isFull()) or (failSafeCounter = 5);
writeln('Inventory is full!');
mineTimer.reset();
toBank();
begin
repeat
wait(randomRange(1000,1500));
findBankz();
until depositBox.isOpen();
Bank();
clearDebug();
progressReport();
toMine();
end;
Antiban();
toMine();
until(loop >= loops);
end.
Simba Code:
program scriptTemplate;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
const
clayPrice = 408;
softClayPrice = 505;
var
LoadsDone, clayLeft: integer;
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'IS';
password := 'PW';
isActive := true;
isMember := false;
end
currentPlayer := 0;
end;
procedure findColorz();
var
slot1Box: TBox;
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit;
if (tabbackPack.isOpen()) then
begin
slot1Box := tabBackPack.getSlotBox(28);
mouseBox(slot1Box, MOUSE_LEFT);
end else
tabbackPack.open();
findColorsSpiralTolerance(x, y, TPA, 9022644, mainScreen.getBounds(), 7, colorSetting(2, 0.07, 0.77));
if (Length(TPA) < 1) then
exit;
ATPA := TPA.toATPA(30, 30);
ATPA.filterBetween(0, 60);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['aterpump'], 500) then
begin
fastClick(MOUSE_LEFT);
break;
end;
end;
end;
procedure toWell();
var
pathToWell: TPointArray;
begin
if not isLoggedIn() Then
exit;
pathToWell := [Point(122, 172), Point(123, 159), Point(124, 146), Point(135, 137), Point(139, 125), Point(130, 114)];
if SPS.walkPath(pathToWell) Then
minimap.waitPlayerMoving()
else
writeLn('Filaed warking');
end;
procedure toBank();
var
pathToBank: TPointArray;
begin
if not isLoggedIn() Then
exit;
pathToBank := [Point(137, 113), Point(139, 125), Point(135, 137), Point(124, 146), Point(123, 159), Point(122, 172)];
if SPS.walkPath(pathToBank) Then
begin
minimap.waitPlayerMoving();
writeln('walked to well!');
exit;
end;
end;
procedure findBank();
var
x, y: integer;
begin
if not isLoggedIn then
players[0].login;
begin
if (players.getActive > 0) then
begin
if (mainscreen.findObject(x, y, 2315624 , 9, colorSetting(2, 0.06, 2.04), mainscreen.getCenterPoint(), 20, 20, 5, ['Bank'])) then
wait(randomRange(500,1500));
writeln('Bank found!');
end;
end;
end;
procedure bank();
var
depositBox, withdrawBox: TBox;
done: integer;
begin
if (bankScreen.isOpen(5000)) then
begin
writeLn('Bank screen found!');
bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
wait(randomRange(1000,2000));
bankscreen.withdraw(1, WITHDRAW_AMOUNT_ALL, ['Clay','Withdra']);
clayleft := bankscreen.getPackCount();
wait(randomRange(1000,2000));
bankscreen.close();
end;
end;
procedure atWell();
var
x,x1,y,y1, softedCount: integer;
softenBox: TBox;
begin
// repeat
wait(randomRange(2500,3000));
softenBox := intToBox(289, 328, 509, 350);
mouseBox(softenBox, MOUSE_LEFT);
wait(randomRange(33000, 35000));
end;
procedure progressReport();
var
claySofted, profit, profitPerHour, clayPerHour: integer;
begin
Inc(LoadsDone);
claySofted := (LoadsDone * 28);
clayPerHour := round((claySofted * 60) / (getTimeRunning() / 60000));
profit := (claySofted * (softClayPrice - ClayPrice));
profitPerHour := round((profit * 60) / (getTimeRunning() / 60000));
writeLn('Time Running: ' + timeRunning);
writeLn('Clay softed: ' + intToStr(claySofted));
writeLn('Clay left: ' + intToStr(clayLeft));
writeLn('Clay/h: ' + intToStr(clayPerHour));
writeLn('Profit made: ' + intToStr(profit));
writeLn('Profit/h: ' + intToStr(profitPerHour));
end;
begin
clearDebug();
disableSRLDebug := true;
smartEnableDrawing := true;
setupSRL();
declarePlayers();
SPS.setup('wellFala', RUNESCAPE_OTHER);
if not isLoggedIn() then
begin
players[currentPlayer].login();
exitSquealOfFortune();
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_NORTH);
end;
LoadsDone = 0;
repeat
findBank();
bank();
toWell();
findColorz();
atWell();
clearDebug();
progressReport();
toBank();
until(false);
end.
I hope some of u guys can give me feedback and tell me what to do bether.