SRL Archive - First Scripts

Noobie Banana Picker


Simbanoobie

2014-10-07 00:17:05

NoobieBananaPicker V1.0

What this script does:

-Picks bananas at Karamja plantation
-Puts them into baskets (carry 5 per inventory slot vs 1)
-Teleports (via Ring of Dueling) to Castle Wars
-Teleports back to Karamja plantation with Amulet of Glory

What this script REQUIRES:

Within Runescape:
-Membership
-Amulets of Glory(4) [ About 3 per hour you want to run the script ]
-Rings of Dueling [ About 1.5 per hour you want to run the script ]
-Baskets [ About 275 per hour you want to run the script ]
-Start At Castle wars Bank OR (see img below)

Make sure your action bar is set up like this. If you start at bank, then it will set it up for you automatically. Again, only the slots inside the red box matter.

Your Bank slots Setup Like So [the script won't do this automatically like the actionbar]:


Outside of Runescape:
-Direct X Include
-SPS Include
-The SPS image at the bottom of the thead [Copy & Save It To Includes –> SPS –> img –> Runescape_Surface]

Not Required but Recommended:

-Start with a Fresh Glory/ROD (That way 50% of the time they line up and you switch out both at same time)
-Make the Chatbox as small as possible (For finding banana trees/bank chest more easily)
-Run on a world that has more people on it (Faster banana re-spawn times I think) I will add World Selection to the player form soon
-Don't Wear Yellow (specifically, bright yellow. e.g. yellow partyhat, bright yellow gnome robes) It will slow down the banana picking.


Potential Updates:


-Add Breaking
-Add World Selection
-Improve banana finding/picking function (it works, but it could be improved for accuracy/speed)

Things to note:

-Bananas are used for fruit bats. They are not a high volume item. This means that they may not, and probably won't sell instantly.
-Baskets of bananas sell more slowly, because many people making fruit bats don't realize that they could use baskets to make fruit bats much faster.
-I did not make this script to use personally, just for learning purposes, so sell them for whatever you want, BUT selling them lower only cuts into your profits.
-Change the basket of banana price to your liking via the playerform(when starting script) to ensure accurate profit/hr. Default is 2000 (that is what they cost when I uploaded the script).

ANY feedback is appreciated. I am just beginning to learn so anything helps.


program NoobieBananaPicker;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$i srl-6/lib/misc/srlplayerform.simba}
{$I SPS/lib/SPS-RS3.Simba}

var
x,y, BasketsFilled, Proggy, BasketPrice: integer;
BasketDTMINV,BasketDTMACTBAR,RODDTM,GloryDTM: integer;
NeedROD,NeedGlory: Boolean;

procedure TeleportToKaramja;
begin
if (FindDtm(GloryDTM,x,y,actionbar.getBounds)) then
begin
gameTabs.openTab(3);
if (FindDTM(GloryDTM,x,y,tabbackpack.getBounds)) then
begin
mouse(x,y,7,7,MOUSE_RIGHT);
sleep (50 + Random (25));
chooseOption._select(['Karamja', 'aramja', 'amja'],MOUSE_LEFT,false,1.00,1500);
sleep(3000 + Random(300));
end;
end;
end;

procedure DoBanking;
begin
if (bankScreen.isOpen = False) then
begin
if (tabBackpack.count < 3) then
begin
if (tabbackpack.clickDTM(RODDTM,MOUSE_LEFT,'',1000)) then
begin
writeln('No Longer Need ROD');
NeedROD := False;
end;
if (tabbackpack.clickDTM(GloryDTM,MOUSE_LEFT,'',1000)) then
begin
writeln('No Longer Need Glory');
NeedGlory := False
end;
end;
if (FindDTM(GloryDTM,x,y,actionbar.getBounds) = False) then
begin
NeedGlory := True;
writeln('Glory Needed');
end;
if (FindDTM(RODDTM,x,y,actionbar.getBounds) = False) then
begin
NeedROD := True;
writeln('ROD Needed');
end;

if (bankScreen.open(BANK_CHEST_CW) = False) then
begin
if (findColorTolerance(x, y, 6666315, mainscreen.getbounds ,10) = False) then
sps.blindWalk(Point(665,196)); // Bank Point
end;
end;

if (bankScreen.isOpen) then
begin
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
if ((NeedGlory = True) OR (NeedROD = True)) then
begin
if (NeedGlory = True) then
begin
bankscreen.withdraw(1, 1, ['of glory', 'mulet of gl', 'ulet', '(4)']);
writeln('Withdrawing New Glory');
end;
if (NeedROD = True) then
begin
bankscreen.withdraw(2, 1, ['of duel', 'ing of', 'duel']);
writeln('Withdrawing New ROD');
end;
bankScreen.close;
sleep(1000 + Random(100));
end;

if ((NeedGlory = False) AND (NeedROD = False)) then
begin
bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
bankscreen.withdraw(3, 23, ['asket', 'Baske']);
bankscreen.close;
sleep (250 + Random(100));
TeleportToKaramja;
end;
end;
end;

procedure setup;
begin
BasketDTMACTBAR := DTMFromString('mlwAAAHicY2dgYLjOxMBwA4gvMEHYD4D4HBDfA+I4RgYGLyCOBeJkKB0GxAFAXJEXy5ASYsFQV5zIkJcaypAS7ctQlBHBkBBoxsAFNBcXZsSDoQAAoPYQiQ==');
BasketDTMINV := DTMFromString('mrAAAAHic42BgYLjBxMBwFYivA/FNIH4MxKeB+BwQPwTiakYI7gTiHCCugeIWIG4G4pQAXYYEX22gSUxYMTuQBGFcgJEAhgEAs5UMoA==');
RODDTM := DTMFromString('mWAAAAHicY2FgYDgHxGeB+BgQXwLiv4wMDDxMDAwcQMwKxBKrZBjWT5dkOL5GhuHVKUUGfqAaZMyIhkEAAEaQCjY=');
GloryDTM := DTMFromString('mbQAAAHicY2VgYFgGxCuBeD0QLwTiJUAswMTA8IuRgYGJCYKFgThTpJfh1YMHDBdPHGc4c/gww91b8gz8QLXomBELBgMA4K4O/w==');
AddOnTerminate('FreeAllDTMs');
BasketsFilled := 0;
end;

procedure FreeAllDTMs;
begin
FreeDTM(BasketDTMACTBAR);
FreeDTM(BasketDTMINV);
FreeDTM(RODDTM);
FreeDTM(GloryDTM);
end;

procedure progressReport();
var
profit, profitPerHour: integer;
begin
profitPerHour := round((BasketsFilled * BasketPrice) /(getTimeRunning() / 3600000));
profit := round((BasketsFilled * BasketPrice));

writeln('===========Banana Picker V1.0============');
writeln(' Baskets Filled: ' + (toStr(BasketsFilled)));
writeln(' Profit: ' + (toStr(profit)));
writeln(' Profit per Hour ' + (toStr(profitPerHour)));
writeLn('Time running: ' + timeRunning(TIME_FORMAL_LONG));
writeln('=========================================');
end;

procedure initialSetup;
begin
exitTreasure();
sleep(500 + Random (300));
minimap.clickCompass;
sleep(500 + Random (300));
mainscreen.setAngle(MS_ANGLE_HIGH);
sleep(500 + Random (300));

if (bankScreen.open(BANK_CHEST_CW)) then
begin
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
sleep(300 + Random (300));
bankscreen.withdraw(1, 1, ['of glory', 'mulet of gl', 'ulet', '(4)']);
sleep(300 + Random (300));
bankscreen.withdraw(2, 1, ['of duel', 'ing of', 'duel']);
sleep(300 + Random (300));
bankscreen.withdraw(3, 1, ['asket', 'sket', 'ask']);
sleep(300 + Random (300));
bankscreen.close;
sleep(1000 + Random (500));
end;

if (FindDTM(BasketDTMINV,x,y,tabbackpack.getBounds)) then
begin
writeln('Adding Basket To Actionbar');
mouse(x,y,9,9,MOUSE_MOVE);
sleep (75 + Random(35));
holdMouse(x, y, MOUSE_LEFT);
sleep (80 + Random(25));
mousebox(actionbar.getSlotBox(3));
sleep (40 + Random (20));
GetMousePos(x,y);
sleep (20 + Random (35));
ReleaseMouse(x,y,MOUSE_LEFT);
end;

if (FindDTM(RODDTM,x,y,tabbackpack.getBounds)) then
begin
writeln('Adding Ring of Dueling To Actionbar');
mouse(x,y,5,5,MOUSE_MOVE);
sleep (75 + Random(35));
holdMouse(x, y, MOUSE_LEFT);
sleep (80 + Random(25));
mousebox(actionbar.getSlotBox(2));
sleep (40 + Random (20));
GetMousePos(x,y);
sleep (20 + Random (35));
ReleaseMouse(x,y,MOUSE_LEFT);
end;

if (FindDTM(GloryDTM,x,y,tabbackpack.getBounds)) then
begin
writeln('Adding Glory To Actionbar');
mouse(x,y,5,5,MOUSE_MOVE);
sleep (75 + Random(35));
holdMouse(x, y, MOUSE_LEFT);
sleep (80 + Random(25));
mousebox(actionbar.getSlotBox(1));
sleep (40 + Random (20));
GetMousePos(x,y);
sleep (20 + Random (35));
ReleaseMouse(x,y,MOUSE_LEFT);
end;
end;

procedure declarePlayers();
var
i: integer;
begin
players.setup(playerForm.players);
currentPlayer := 0;

for i := 0 to high(players) do
with players[i] do
begin
integers[0] := strToInt(playerForm.players[i].settings[0]);
integers[1] := strToInt(playerForm.players[i].settings[1]);
integers[2] := strToInt(playerForm.players[i].settings[2]);
integers[3] := strToInt(playerform.players[i].settings[3]);
BasketPrice := strToInt(playerform.players[i].settings[4]);
end;
end;

procedure initPlayerForm();
begin
with playerForm do
begin
name := 'BananaPicker V1.0';
scriptHelpThread := '';
editBoxLabels := ['Not Yet Used', 'Not Yet Used', 'Not Yet Used', 'Not Yet Used','Basket Of Bananas Price'];
editBoxDefaults := ['0', '0', '0','0','2000'];
end;
end;

procedure PickBananas();
var
i: integer;
begin
if(FindDTM(BasketDTMACTBAR,x,y,actionbar.getBounds) = True) then
begin
if (tabBackPack.isFull) then
begin
case random(10) of
0..7: Typesend('3',false);
8..9: actionbar.clickSlot(3);
end
BasketsFilled := (BasketsFilled + 1);
end;
if (mainscreen.findObject(x, y, [1569018, 1702910, 1297886 ], [13, 11, 11], colorSetting(2, 0.02, 0.13), mainscreen.getCenterPoint(), 10, 10, 1, ['ick Ban'], mainscreen.getBounds(), MOUSE_NONE) = False) then
sps.blindWalk(Point(218,226)); // Middle of Banana Plantation
if (mainscreen.findObject(x, y, [1569018, 1702910, 1297886 ], [13, 11, 11], colorSetting(2, 0.02, 0.13), mainscreen.getCenterPoint(), 10, 10, 1, ['ick Ban'], mainscreen.getBounds(), MOUSE_MOVE)) then
begin
if isMouseOverText(['ick Ban', 'ick'], 500) then
begin
if (minimap.isPlayerMoving(100) = False) then
begin
Mouse(Point(x,y),MOUSE_LEFT,MOUSE_HUMAN);
tabBackPack.waitForShift(2000 + Random(250));
end;
end;
end;
end;


if(FindDTM(BasketDTMACTBAR,x,y,actionbar.getBounds) = False) then
begin
if (findColorTolerance(x, y, 6666315, mainscreen.getbounds ,10) = True) then
begin
if (FindDtm(RODDTM,x,y,actionbar.getBounds)) then
begin
gameTabs.openTab(3);
if (FindDTM(RODDTM,x,y,tabbackpack.getBounds)) then
begin
mouse(x,y,7,7,MOUSE_RIGHT);
sleep (50 + Random (25));
chooseOption._select(['astle War', 'stle Wa', 'tle Wa'],MOUSE_LEFT,false,1.00,1500)
end;
sleep(5000 + Random(300));
end;
end;
end;
end;

begin
initPlayerForm();
runPlayerForm();
declarePlayers();
if (not playerForm.isScriptReady) then
exit;
SmartEnableDrawing := True;
smartPlugins := ['OpenGL32.dll','d3d9.dll'];
setupSRL();
disableSRLDebug := True;
setup;
sps.setup('BananaPickerMap', RUNESCAPE_SURFACE, 4, 600.0, 0.40)
repeat
if (Proggy > 50) then
begin
ProgressReport;
Proggy := 0;
end;
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(randomRange(5000, 6000));
initialsetup;
end;

if isLoggedIn() then
begin
exitTreasure();
Proggy := Proggy + 1;
if (findColorTolerance(x, y, 6666315, mainscreen.getbounds ,10) = True) then
PickBananas;
if (findColorTolerance(x, y, 6666315, mainscreen.getbounds ,10) = False) then
DoBanking;
end;
until false
end.

===========Banana Picker V1.0============
Baskets Filled: 737
Profit: 1474000
Profit per Hour 550913
Time running: 2 Hours 40 Minutes 32 Seconds
=========================================

Incurable

2014-10-07 00:36:54

Congratulations for releasing your first script!



A solid first script, well done. :D

Feedback:

1. Depending on whether or not your script is able to get lost, you should crop your SPS maps to look more like this:


… instead of including the UI in the map. If SPS ever tried to walk near the edge of your map, it would almost certainly fail.

2. Your indenting and standards are really good, but they do need to be fixed in a couple of places, for example, this:


procedure FreeAllDTMs;
begin
FreeDTM(BasketDTMACTBAR);
FreeDTM(BasketDTMINV);
FreeDTM(RODDTM);
FreeDTM(GloryDTM);
end;

… should look like this:


procedure FreeAllDTMs;
begin
FreeDTM(BasketDTMACTBAR);
FreeDTM(BasketDTMINV);
FreeDTM(RODDTM);
FreeDTM(GloryDTM);
end;

Also, I noticed that some of your procedures are in PascalCase, and others are in camelCase. Unless you're doing something like putting procedures in PascalCase and functions in camelCase (which I do), you should pick one and stick to it. It doesn't generally matter to most people which one you choose to do so long as you're consistent in your approach. ;)

3. Why you have you got such large random sleeps in your initialSetup procedure?

Again, congrats! :D

Ian

2014-10-07 00:54:53

Congrats on your first script! :D

I'll read through it sometime tomorrow and post any suggestions for improvement. (If I forget, please remind me by quoting this post)

Simbanoobie

2014-10-07 05:47:53

From: Incurable
Congratulations for releasing your first script!



A solid first script, well done. :D

Feedback:

1. Depending on whether or not your script is able to get lost, you should crop your SPS maps to look more like this:


… instead of including the UI in the map. If SPS ever tried to walk near the edge of your map, it would almost certainly fail.

2. Your indenting and standards are really good, but they do need to be fixed in a couple of places, for example, this:


procedure FreeAllDTMs;
begin
FreeDTM(BasketDTMACTBAR);
FreeDTM(BasketDTMINV);
FreeDTM(RODDTM);
FreeDTM(GloryDTM);
end;

… should look like this:


procedure FreeAllDTMs;
begin
FreeDTM(BasketDTMACTBAR);
FreeDTM(BasketDTMINV);
FreeDTM(RODDTM);
FreeDTM(GloryDTM);
end;

Also, I noticed that some of your procedures are in PascalCase, and others are in camelCase. Unless you're doing something like putting procedures in PascalCase and functions in camelCase (which I do), you should pick one and stick to it. It doesn't generally matter to most people which one you choose to do so long as you're consistent in your approach. ;)

3. Why you have you got such large random sleeps in your initialSetup procedure?

Again, congrats! :D


1. That makes sense. The amount of distance I walk is only a few steps so it doesn't matter but I can see how it could interfere with walking a longer path.
2. As far as indenting goes I started writing this last night at 10:30pm (and now am going to work at 5:45 am :P) so was in a bit of a rush. I'll try to stick to naming conventions. The camelcase/pascalcase I definitely need to pick one :P there's really no rhyme of reason to which i use now
3. I don't know, honestly. It is only run once when you log in. I guess maybe I was thinking initially you might be laggy and need the time? Who knows :P

ibot101

2014-10-07 14:55:54

just to clarify: once the bananas are in the basket, you sell the basket as an item right? not taking out the bananas later then selling them on their own and reusing the baskets?

Simbanoobie

2014-10-07 16:13:39

From: ibot101
just to clarify: once the bananas are in the basket, you sell the basket as an item right? not taking out the bananas later then selling them on their own and reusing the baskets?


I suppose you could do it either way, but baskets are only 4GP each so saving them isn't really a priority. Loose bananas might sell faster than baskets though. With a good banking method and quick-select inventories/actionbar keybinds you could probably unbasket 1500+ baskets per hour (7500 bananas).

ibot101

2014-10-07 17:51:55

alright :) I'll probably try this out in a few days and hopefully get some good proggies for you :P

the bank

2014-10-09 14:23:24

Looks great, been running it for a couple hours now!

wowgnomes

2014-10-26 09:55:10

This is a pretty solid script – I was able to run it for 4 hours before stopping it manually (And losing the proggy -_-)

My only concern is when it first gets to the island and clicks to the North east for a couple of seconds before picking bananas

LightningRod

2014-11-06 15:59:04

Running it now and it was having troubles withdrawing amulet and ring and then just depositing it again. But now i got it to work but it still thinks the amulet is a banana and trys to "Pick" the amulet, sometimes the tree is there and it clicks the tree, other times it clicks on the player. No problem though it continues and i will hopefully post a 3-4 hour progress report, I have 1k baskets and im thinking i might get to 4 hours. profit shows right now is really low, but thats because it spent 4-5 at the bank messing around

LightningRod

2014-11-06 16:43:28

Also, The calculater is messed up, it would be correct if i was banking 28 baskets of bananas, but it is only 23 baskets, so the calculated gp is not right and the gp/hour is off also… Other than this it is a great script that requires no previous stats

Trollcrank

2014-11-09 11:40:43

"selling them lower only cuts into your profits."

That's in the title, could you bold that for me?

As for the script, it's a fantastic first script. Here are some places where the spacing could be fixed.

begin
NeedGlory := True;
writeln('Glory Needed');
end;

if (findColorTolerance(x, y, 6666315, mainscreen.getbounds ,10) = False) then
sps.blindWalk(Point(665,196)); // Bank Point
end;

if (FindDTM(GloryDTM,x,y,tabbackpack.getBounds)) then
begin
writeln('Adding Glory To Actionbar');
mouse(x,y,5,5,MOUSE_MOVE);
sleep (75 + Random(35));
holdMouse(x, y, MOUSE_LEFT);
sleep (80 + Random(25));
mousebox(actionbar.getSlotBox(1));
sleep (40 + Random (20));
GetMousePos(x,y);
sleep (20 + Random (35));
ReleaseMouse(x,y,MOUSE_LEFT);
end;

To This:

begin
NeedGlory := True;
writeln('Glory Needed');
end;

if (findColorTolerance(x, y, 6666315, mainscreen.getbounds ,10) = False) then
sps.blindWalk(Point(665,196)); // Bank Point
end;

if (FindDTM(GloryDTM,x,y,tabbackpack.getBounds)) then
begin
writeln('Adding Glory To Actionbar');
mouse(x,y,5,5,MOUSE_MOVE);
sleep (75 + Random(35));
holdMouse(x, y, MOUSE_LEFT);
sleep (80 + Random(25));
mousebox(actionbar.getSlotBox(1));
sleep (40 + Random (20));
GetMousePos(x,y);
sleep (20 + Random (35));
ReleaseMouse(x,y,MOUSE_LEFT);
end;

Still way better than my first script, your spacing is pretty darn good. I wish I spaced it properly like that when I first started :p

TimeRiders

2014-11-12 20:59:45

Nice job for your first script bud !

xCrazyGuyNL

2014-11-13 16:41:43

this looks like a super nice script to begin with :D

fgamer

2015-03-11 08:04:18

===========Banana Picker V1.0============
Baskets Filled: 561
Profit: 1122000
Profit per Hour 603314
Time running: 1 Hour, 51 Minutes and 35 Seconds
=========================================


Made a few edits to the script, getting like 50 more baskets/h. = 70k more profit/h.

fgamer

2015-03-17 15:37:05

===========Banana Picker V1.0============
Baskets Filled: 25.550
Profit: 30660000
Profit per Hour 419986
Time running: 72 Hours 59 Minutes 54 Seconds
=========================================

I've made 100M using this bot.
Really nice one, but make it detect if it is out of basket, because it keeps teleporting when it is out of baskets, you should let it shut the script down.

Machu

2015-03-19 07:49:34

From: fgamer
===========Banana Picker V1.0============
Baskets Filled: 25.550
Profit: 30660000
Profit per Hour 419986
Time running: 72 Hours 59 Minutes 54 Seconds
=========================================

I've made 100M using this bot.
Really nice one, but make it detect if it is out of basket, because it keeps teleporting when it is out of baskets, you should let it shut the script down.


You can edit it easily, so it will disconnect instead. Inbox if needed.

Buxtons

2015-03-19 08:08:33

This actually looks really good. I'll be starting to use it on my alt to save for 99 Herblore. ;)

nero_dante

2015-05-08 17:05:47

Can't seem to get this to work at all. It logs me in and then the script just doesn't start up… anyone know the reason for this?