SRL Archive - First Scripts

[F2P] Potato Picker 120-200k an hour, looking for suggestions.


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.


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

Justin

2014-09-29 22:34:21

Congratulations on release!

NKN

2014-09-29 22:37:04

Nice release!

As for your gate issue, is the gate red on the minimap?

Incurable

2014-09-29 22:42:58

Not bad for a first script!

Since there's not a lot you can do for antiban, you should consider a breaking system instead. This say you can take breaks when a human would realistically be bored of picking and baking repeatedly. ;)

yourule97

2014-09-30 10:35:33

From: Justin
Congratulations on release!


Thanks!


From: NKN
Nice release!

As for your gate issue, is the gate red on the minimap?


That's a good idea. Sometimes the SPS pathing moves too far away from the gate for it to be found. This seems like a much better solution.


From: Incurable
Not bad for a first script!

Since there's not a lot you can do for antiban, you should consider a breaking system instead. This say you can take breaks when a human would realistically be bored of picking and baking repeatedly. ;)


Thanks for the suggestion! Its very logical. I'm just not willing to add it in because honestly I'm lazy and I plan to use this scripts with only fresh accounts which I wouldnt mi

Hoodz

2014-09-30 10:43:40

wannabe @Wetish; ;)

NKN

2014-09-30 14:32:56

From: yourule97
Thanks!




That's a good idea. Sometimes the SPS pathing moves too far away from the gate for it to be found. This seems like a much better solution.




Thanks for the suggestion! Its very logical. I'm just not willing to add it in because honestly I'm lazy and I plan to use this scripts with only fresh accounts which I wouldnt mi


I was going more along the idea of using the red then using pointToMainscreen to plot a general location, then search inside a box created from those points. Eliminates a lot of the overhead.

Wetish

2014-09-30 14:51:32

From: NKN
I was going more along the idea of using the red then using pointToMainscreen to plot a general location, then search inside a box created from those points. Eliminates a lot of the overhead.


Thats what I did when I wrote a very similar script a year or so ago.

From: yourule97

I hope this doesn't crash potato prices, but it probably will once it runs better.


The current price is highly inflated because I haven been buying potatoes for my collection. I started buying them when they were around 130gp each.

Once you sell about 110k potatoes I will not longer be buying and the price might crash.

yourule97

2014-09-30 16:44:20

From: NKN
I was going more along the idea of using the red then using pointToMainscreen to plot a general location, then search inside a box created from those points. Eliminates a lot of the overhead.


That's much smarter than what I had in mind before! Thanks for the insight.



From: Wetish
Thats what I did when I wrote a very similar script a year or so ago.



The current price is highly inflated because I haven been buying potatoes for my collection. I started buying them when they were around 130gp each.

Once you sell about 110k potatoes I will not longer be buying and the price might crash.


Pls giff money. I am poor peasant

Godless

2014-10-02 06:08:38

I'm fairly sure a few people collect them, so hopefully it doesn't crash too much.

wowgnomes

2014-10-26 09:56:32

is this to like train cooking, or just for potato hoarders lol

icyhottt

2014-11-28 19:25:53

^hahaah I was wondering the same thing

xqs_me

2015-01-02 18:05:18

Just to gather them taters me thinks?

Lobster

2015-03-29 08:18:44

Has anyone tried this recently? I was looking to start my own potato picker script to learn but found this tucked away here. Would this be a safeish script to try?

WYD

2015-03-30 12:03:24

===========Overlord's Potato Banker============
Potatos Picked: 196
Profit: 81928
Profit per Hour 149474
Potential Profit per hour: 214556
Time running: 32m 53s

Something to do
1.Gate
2.Bypass 6hours
3.antiban

WYD

2015-03-31 07:39:41

Bug

yourule97

2015-03-31 15:23:06

I can't believe anyone is deciding to use this. It's absolute garbage. I'll try and freshen things up

WYD

2015-03-31 15:34:15

I have fix my haha with some help