Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Accepting Script Requests (FREE)

Featured Replies

I'm new and want to learn. If you have any simple script ideas or a want a simple personalized script i'll be willing to make it for free.

2 hours ago, bubbajim said:

I'm new and want to learn. If you have any simple script ideas or a want a simple personalized script i'll be willing to make it for free.

How about you try and make a Cadava berries picker. It should walk to the pick area. Pick till inventory is full. Then bank and repeat. Also if web walking doesn't path you away from the wizards when banking make it do that. Once this is completed try expanding on it with automatically selling the berries to GE. I am pretty sure you don't need 7QP to sell these.


This wiki page should give you the info on where to find them https://oldschool.runescape.wiki/w/Cadava_berries

Let me know if this was too easy and I will think of something else you could make.

Edited by Gunman

  • Author
22 hours ago, Gunman said:

How about you try and make a Cadava berries picker. It should walk to the pick area. Pick till inventory is full. Then bank and repeat. Also if web walking doesn't path you away from the wizards when banking make it do that. Once this is completed try expanding on it with automatically selling the berries to GE. I am pretty sure you don't need 7QP to sell these.


This wiki page should give you the info on where to find them https://oldschool.runescape.wiki/w/Cadava_berries

Let me know if this was too easy and I will think of something else you could make.

Thanks for the idea. I've finished everything except the GE part. Basically you start the script either in the bush area or Varrock west bank and it will go to the berries (avoiding the wizards) and pick what ever is available. Once its finished picking it hops to the next world and picks from there (cycling through world 460 to 451). Its very basic and doesn't have very many fail safes so i think its a little fragile at this point. Despite that, it seems to be running pretty good so far. The biggest challenge i faced was picking the berries and using the conditional sleep. When you pick the berry the id of the entity changes, so i had it wait for the id to change of the current bush you were picking. 

 

I would really appreciate any feedback you have. Thanks.

import org.osbot.rs07.api.Settings;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;
import java.awt.*;
import java.util.concurrent.TimeUnit;

@ScriptManifest(name = "Bubba's Berries", author = "bubbajim", version = 1.0, info = "", logo = "")

public class BubbasBerries extends Script {
    private long startTime;
    private int berriesCounter;
    private int startWorld = 460;
    private int endWorld = 451;
    private int currentWorld = startWorld;
    private long currentInventoryCapacity = -5;

    Position pathInBetween = new Position(3290, 3397, 0);
    Position pathFromBank = new Position(3273, 3370, 0);
    Position pathToBank = new Position(3252, 3420, 0);

    Area bankArea = new Area(new Position(3257, 3423, 0),
            new Position(3250, 3420, 0));

    @Override
    public void onStart() {
        startTime = System.currentTimeMillis();
    }

    @Override
    public void onExit() {
    }

    @Override
    public int onLoop() throws InterruptedException {
        if (getInventory().getAmount(753) == currentInventoryCapacity + 1) {
            berriesCounter += 1;
        }
        currentInventoryCapacity = getInventory().getAmount(753);

        Settings settings = getSettings();
        int runEnergy = settings.getRunEnergy();
        if (runEnergy > 50 && !settings.isRunning()) {
            settings.setRunning(true);
        }

        if (getInventory().isFull()) {
            getWalking().webWalk(pathInBetween);
            getWalking().webWalk(pathToBank);
            getBank().open();
            sleep(random(1500,2500));
            getBank().depositAll();
            new ConditionalSleep(10000) {
                @Override
                public boolean condition() {
                    return getInventory().isEmpty();
                }
            }.sleep();
        }

        Entity cadavaBush = getObjects().closest(23625, 23626);

        if (bankArea.contains(myPosition())) {
            getWalking().webWalk(pathInBetween);
            getWalking().webWalk(pathFromBank);
        }

        else if (cadavaBush != null && cadavaBush.interact("Pick-from")) {
            int cadavaBushX = cadavaBush.getX();
            int cadavaBushY = cadavaBush.getY();
            Position cadavaBushPosition = new Position(cadavaBushX, cadavaBushY, 0);

            if (cadavaBush.getId() == 23625) {
                new ConditionalSleep(10000) {
                    @Override
                    public boolean condition() {
                        return getObjects().closest(o -> o.getPosition().equals(cadavaBushPosition)).getId() == 23626;
                    }
                }.sleep();
            } else if (cadavaBush.getId() == 23626) {
                new ConditionalSleep(10000) {
                    @Override
                    public boolean condition() {
                        return getObjects().closest(o -> o.getPosition().equals(cadavaBushPosition)).getId() == 23627;
                    }
                }.sleep();
            }
        } else {
            if (endWorld == currentWorld) {
                currentWorld = startWorld;
            }
            currentWorld -= 1;
            getTabs().open(Tab.LOGOUT);
            getWorlds().hop(currentWorld);
            sleep(random(2000,3000));
            getTabs().open(Tab.INVENTORY);
            new ConditionalSleep(10000) {
                @Override
                public boolean condition() {
                    return getWorlds().getCurrentWorld() == currentWorld;
                }
            }.sleep();
        }
        return random(300, 600);
    }

    @Override
    public void onPaint(Graphics2D g) {
        final long runTime = (System.currentTimeMillis() - startTime);
        String hms = String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(runTime),
                TimeUnit.MILLISECONDS.toMinutes(runTime) % TimeUnit.HOURS.toMinutes(1),
                TimeUnit.MILLISECONDS.toSeconds(runTime) % TimeUnit.MINUTES.toSeconds(1));
        Font font = new Font("Open Sans", Font.PLAIN, 12);
        g.setFont(font);
        g.setColor(Color.green);
        g.drawString("Time elapsed: " + hms, 15, 300);
        g.drawString("Berries picked: " + berriesCounter, 15, 315);
    }
}

 

image.png.0457c188393a88b43b96a8e331abc0da.pngBubbasBerries.java

@bubbajim Nice job! In case you didn't know you don't need to set an area for the bank. The API has most banks built in.

 

Spoiler

getWalking().webWalk(Banks.VARROCK_EAST);

You can just replace "VARROCK_EAST" With whatever bank you want like Edgeville bank.


getWalking().webWalk(Banks.EDGEVILLE);

 

 

Also this is my opinion but I would separate walking, picking, and world hoping into there own voids with log(); saying it is doing the walking portion or picking because I find that easier for ME to debug.

  • Author
3 hours ago, Gunman said:

@bubbajim Nice job! In case you didn't know you don't need to set an area for the bank. The API has most banks built in.

 

  Hide contents


getWalking().webWalk(Banks.VARROCK_EAST);

You can just replace "VARROCK_EAST" With whatever bank you want like Edgeville bank.



getWalking().webWalk(Banks.EDGEVILLE);

 

 

Also this is my opinion but I would separate walking, picking, and world hoping into there own voids with log(); saying it is doing the walking portion or picking because I find that easier for ME to debug.

Thanks a lot for the feedback. I didn't know you could do that with walking. And I will separate those things into their own functions. You're right, its much easier to debug and much cleaner to read.

On 8/15/2019 at 12:46 AM, bubbajim said:

Thanks a lot for the feedback. I didn't know you could do that with walking. And I will separate those things into their own functions. You're right, its much easier to debug and much cleaner to read.

i've pmed u

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.