yourule97
2014-09-29 21:53:36
I've been working on this script for a little while, and its almost perfect. However….. it includes opening a gate and I can't get the script to run flawlessly for more than around 20-30 mins. I'm not good at TPA and ATPA yet, but I think I have everything else done.
I hope this doesn't crash potato prices, but it probably will once it runs better. Oh well….. I did it for the coding experience.
Description:
Start the script in the Lumbridge Combat Training Area next to the bank with an empty inventory preferable. This uses the DirectX plugin and also is optimized with the smallest possible chatbox.
It runs from the bank location to the potato field, and all the way back.
To Do List:
1. Find a better way to find and open the gate (All help is appreciated!)
2. Add more failsafes
3. Include a price getter.
3. Add antiban (Not a priority because the script requires literally no stats)
4. Fix spacing. Still used to java, I hate this part and will probably procrastinate :)
If you use this script, never sell potatoes for below mid. NEVER DO IT THEY WILL SELL EVENTUALLY. If you are exceptionally patient, you can do a 150% mark up which is why I included a potential profit per hour in the progress report.
[ATTACH=CONFIG]24116[/ATTACH]
Place this in runescape_other folder as "path"
EDIT
The potato picker has finally moved out of beta stages and has now received a nice facelift!
Download [ATTACH]25506[/ATTACH]
I haven't put it through proper testing for long periods of time, but oh well, its better than before.
New SPS image: http://i.imgur.com/eiM5iT5.png
I hope this doesn't crash potato prices, but it probably will once it runs better. Oh well….. I did it for the coding experience.
Description:
Start the script in the Lumbridge Combat Training Area next to the bank with an empty inventory preferable. This uses the DirectX plugin and also is optimized with the smallest possible chatbox.
It runs from the bank location to the potato field, and all the way back.
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.
To Do List:
1. Find a better way to find and open the gate (All help is appreciated!)
2. Add more failsafes
3. Include a price getter.
3. Add antiban (Not a priority because the script requires literally no stats)
4. Fix spacing. Still used to java, I hate this part and will probably procrastinate :)
If you use this script, never sell potatoes for below mid. NEVER DO IT THEY WILL SELL EVENTUALLY. If you are exceptionally patient, you can do a 150% mark up which is why I included a potential profit per hour in the progress report.
[ATTACH=CONFIG]24116[/ATTACH]
Place this in runescape_other folder as "path"
EDIT
The potato picker has finally moved out of beta stages and has now received a nice facelift!
Download [ATTACH]25506[/ATTACH]
I haven't put it through proper testing for long periods of time, but oh well, its better than before.
New SPS image: http://i.imgur.com/eiM5iT5.png
I started buying them when they were around 130gp each.