Simba Code:
program PotatoPicker;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$I SPS/lib/SPS-RS3.Simba}
var //Global
pathToPotato, pathToBank, pathOutPotato: TPointArray;
picked: integer;
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := '';
password := '';
isActive := true;
world := -1;
isMember := true;
end
currentPlayer := 0;
end;
procedure setupPaths();
begin
pathToPotato := [Point(123, 332), Point(142, 324), Point(166, 322), Point(211, 321), Point(204, 285), Point(202, 244), Point(200, 206), Point(204, 165), Point(214, 142), Point(238, 119), Point(264, 98), Point(281, 87), Point(292, 90)];
pathToBank := [Point(283, 86), Point(268, 93), Point(252, 111), Point(226, 127), Point(207, 148), Point(200, 182), Point(204, 209), Point(197, 238), Point(209, 268), Point(204, 306), Point(188, 320), Point(157, 321), Point(121, 328), Point(112, 333)];
pathOutPotato := [Point(268, 139), Point(280, 123), Point(289, 107), Point(296, 93)];
end;
procedure walkToPotato();
begin
if not isLoggedIn() then
exit;
writeLn('Walking to the Field');
minimap.setAngle(MS_ANGLE_HIGH);
if SPS.walkPath(pathToPotato) then
minimap.waitPlayerMoving();
end;
procedure walkToBank();
begin
if not isLoggedIn() then
exit;
writeLn('Walking to the Bank');
minimap.setAngle(MS_ANGLE_HIGH);
if SPS.walkPath(pathToBank) then
minimap.waitPlayerMoving();
end;
procedure walkOutField();
begin
if not isLoggedIn() then
exit;
minimap.setAngle(MS_ANGLE_HIGH);
if SPS.walkPath(pathOutPotato) then
minimap.waitPlayerMoving();
wait(randomRange(2000, 2500));
end;
procedure findGate();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
gateTimer:TTimeMarker;
begin
if not isLoggedIn() then
exit;
repeat
writeLn('Finding Gate');
minimap.setAngle(MS_ANGLE_HIGH);
findColorsSpiralTolerance(x, y, TPA, 7439776, mainScreen.getBounds(), 12, colorSetting(2, 0.18, 0.68));
if length(TPA) < 1 then
exit;
ATPA := tpa.cluster(2);
ATPA.filterBetween(0, 20);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA); //This is here for debugging purposes
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['pen'], 800) then
begin
writeLn('Opening Gate!');
fastClick(MOUSE_LEFT);
smartImage.clear;
wait(randomrange(2000, 3500));
exit();
end;
if isMouseOverText(['lose'], 800) then
begin
writeLn('Gate is already open!');
smartImage.clear();
exit();
end;
end;
until (gateTimer.getTime() > 75000);
end;
procedure clickPotatos();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit;
writeLn('Finding Potatos');
repeat
findColorsSpiralTolerance(x, y, TPA, 13151330, mainScreen.getBounds(), 12, colorSetting(2, 3.59, 1.67));
if length(TPA) < 1 then
exit;
ATPA := TPA.toATPA(20, 40);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
//smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['otato'], 800) then
begin
fastClick(MOUSE_LEFT);
smartImage.clear;
if tabBackpack.waitForShift(7000) then
begin
wait(randomrange(2000, 3000));
inc(picked);
break;
end;
end
end;
until tabBackpack.isFull();
end;
procedure bank();
var
x, y, i, picked: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit;
writeLn('Finding Potatos');
findColorsSpiralTolerance(x, y, TPA, 11181201, mainScreen.getBounds(), 3, colorSetting(2, 0.34, 0.49));
if length(TPA) < 1 then
exit;
ATPA := TPA.toATPA(40, 40);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['hest'], 800) then
begin
fastClick(MOUSE_LEFT);
smartImage.clear;
if (bankScreen.isOpen(randomrange(4000, 5000))) then
begin
writeln('Bankscreen is open!');
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
writeln('Deposited');
wait(randomrange(1000, 2000));
bankScreen.close()
end;
end;
end;
end;
procedure progressReport();
var
profit, profitPerHour, potentialProfit: integer;
begin
profitPerHour := round((picked * 418 * 60 /(getTimeRunning() / 60000))); //Can be edited by the user
potentialProfit := round((picked * 600 * 60 /(getTimeRunning() / 60000))); //Can also be edited
profit := round((picked*418));
writeln('===========Overlord''s Potato Banker============');
writeln(' Potatos Picked: ' + (toStr(picked)));
writeln(' Profit: ' + (toStr(profit)));
writeln(' Profit per Hour ' + (toStr(profitPerHour)));
writeln(' Potential Profit per hour: ' + (toStr(potentialProfit))); //This line is added in because potato prices are very flexible
writeLn(' Time running: ' + timeRunning(TIME_SHORT));
writeln('================================================');
end;
begin
clearDebug();
DisableSRLDebug := true;
smartPlugins := ['d3d9.dll'];
smartEnableDrawing := true;
setupSRL();
declarePlayers();
SPS.setup('path', RUNESCAPE_OTHER);
setupPaths();
repeat
begin;
exitTreasure();
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(randomRange(4000, 6000));
mainscreen.setAngle(MS_ANGLE_HIGH);
end;
if tabBackpack.count() = 28 then
begin
walktoBank();
bank();
progressReport();
end;
walkToPotato();
findGate();
clickPotatos();
walkOutField();
findGate();
walkToBank();
bank();
progressReport();
end;
until(false);
end.