Jump to content

F2P - ~30k/hr - Banana Picking


Abysm

Recommended Posts

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 by Abysm
  • Like 2
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

10 minutes ago, Magerange said:

I was thinking about bananas at one point, but the market seems too small :feels:
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 :boge: *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 :???:

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...