Abysm Posted June 28, 2017 Share Posted June 28, 2017 (edited) Hello! I basically did this almost useless Banana picking bot for learning purposes. It picks bananas in karamja then uses charter ship to port sarim and uses deposit box to bank bananas, repeats no other requirement other than having coins in your inventory! Makes around 30k gp/hour Scripts gets stuck sometimes (idles for 20 seconds?) with charter ships (I guess its a bug with webwalking) Download .jar file and put it in your \OSBot\Scripts Source code: Spoiler import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.awt.*; @ScriptManifest(name = "BananaPicker", author = "Abysm", info = "Picks bananas in karamja", version = 0.1, logo = "") public final class BananaPicker extends Script { private final Area BananaArea = new Area(2934, 3154, 2905, 3176); private final Area DepositArea = new Area(3045, 3235, 3050, 3237); private long startTime; @Override public final void onStart(){ startTime = System.currentTimeMillis(); } public final int onLoop() throws InterruptedException { if (canPickBananas()) { Pick(); } else { deposit(); } return random(150, 200); } private void Pick() { RS2Object Bananatree1 = getObjects().closest(2072,2073,2074,2075,2076,2077); if (!BananaArea.contains(myPosition())) { getWalking().webWalk(BananaArea); } else if (!getInventory().isFull()) { if (myPlayer().isMoving()) { new ConditionalSleep(2000) { @Override public boolean condition() { return myPlayer().isMoving(); } }.sleep(); } else Bananatree1.interact("Pick"); } } private boolean canPickBananas() { return !getInventory().isFull(); } private void deposit() throws InterruptedException { if (!DepositArea.contains(myPosition())) { getWalking().webWalk(DepositArea); } else if (!getDepositBox().isOpen()) { getDepositBox().open(); } else if (!getInventory().isEmptyExcept("Coins")) { getDepositBox().depositAllExcept("Coins"); } else { stop(true); } } @Override public void onPaint(final Graphics2D g) { Graphics2D paint = (Graphics2D) g.create(); long Runtime = System.currentTimeMillis() - startTime; paint.drawString("Time running: " + formatTime(Runtime), 10, 325); } public final String formatTime(final long ms) { long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } } Edited June 28, 2017 by Abysm 2 Quote Link to comment Share on other sites More sharing options...
Chris Posted June 28, 2017 Share Posted June 28, 2017 ty for using onLoop bro! ezpz 1 Quote Link to comment Share on other sites More sharing options...
Abysm Posted June 28, 2017 Author Share Posted June 28, 2017 9 minutes ago, Chris said: ty for using onLoop bro! ezpz Yeah this is basically my second script, first one was just simple oak power woodcutting script I'm gonna probably try to learn to do state based scripts soon 1 Quote Link to comment Share on other sites More sharing options...
Antonio Kala Posted June 28, 2017 Share Posted June 28, 2017 Try doing a wc script now :P Quote Link to comment Share on other sites More sharing options...
Chris Posted June 28, 2017 Share Posted June 28, 2017 16 minutes ago, Abysm said: Yeah this is basically my second script, first one was just simple oak power woodcutting script I'm gonna probably try to learn to do state based scripts soon just use onLoop bro Quote Link to comment Share on other sites More sharing options...
Abysm Posted June 28, 2017 Author Share Posted June 28, 2017 1 minute ago, Chris said: just use onLoop bro I've been lurking on this forum for some time and people usually say task script is better for more complex scripts (I know I'm not gonna make a "complex" script in years) but is it possible to make really good script just using onLoop? I'm talking about zulrah/barrows level script Quote Link to comment Share on other sites More sharing options...
Chris Posted June 28, 2017 Share Posted June 28, 2017 13 minutes ago, Abysm said: I've been lurking on this forum for some time and people usually say task script is better for more complex scripts (I know I'm not gonna make a "complex" script in years) but is it possible to make really good script just using onLoop? I'm talking about zulrah/barrows level script yeh if you structure it correctly bro 1 Quote Link to comment Share on other sites More sharing options...
Magerange Posted June 28, 2017 Share Posted June 28, 2017 (edited) I was thinking about bananas at one point, but the market seems too small Perhaps the issue is that I was planning on like 25 - 30 bots at the same time. On a small scale this probably is pretty good *hint*Better than oaks *hint* Edited June 28, 2017 by Magerange Quote Link to comment Share on other sites More sharing options...
Abysm Posted June 28, 2017 Author Share Posted June 28, 2017 10 minutes ago, Magerange said: I was thinking about bananas at one point, but the market seems too small Perhaps the issue is that I was planning on like 25 - 30 bots at the same time. On a small scale this probably is pretty good *hint*Better than oaks *hint* I remember playing back in the day, normally just catching lobsters at karamja and noting them at the guy near volcano. One day a guy came to trade me and he literally had like 6m worth of bananas noted Quote Link to comment Share on other sites More sharing options...
Eliot Posted June 28, 2017 Share Posted June 28, 2017 I love this so much. What is better than a banana script? Good job! 1 Quote Link to comment Share on other sites More sharing options...
TrapMan Posted June 28, 2017 Share Posted June 28, 2017 Just tested it out for a hour. It went pretty decent. 1 Quote Link to comment Share on other sites More sharing options...
Abysm Posted June 28, 2017 Author Share Posted June 28, 2017 2 minutes ago, Eliot said: I love this so much. What is better than a banana script? Good job! Haha thanks! It's really shitty money maker but atleast you get dem bananas 1 minute ago, TrapMan said: Just tested it out for a hour. It went pretty decent. Nice proggy dude! Quote Link to comment Share on other sites More sharing options...
Code Hero Posted October 9, 2017 Share Posted October 9, 2017 I like it. Quote Link to comment Share on other sites More sharing options...
botscape1738 Posted October 10, 2017 Share Posted October 10, 2017 Simple, but efficient! Great release. Thanks for posting the source! Always fun to read/follow through. Quote Link to comment Share on other sites More sharing options...
Apaec Posted October 10, 2017 Share Posted October 10, 2017 Nice work! If you're having problems with the webwalker though; i'd suggest switching over to a different system like pathwalking. Web walking is only really designed if your target or destination is unknown/dynamic - since this isn't the case for you, there's no need to use it! Apa Quote Link to comment Share on other sites More sharing options...