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.

Script help

Featured Replies

This is my first real script after doing a few basic ones. I am trying to make a script that collects and deposits planks from the barb outpost. It is currently trying to collect planks even when the inventory is full. It also seems to not want to open the bank. If you have solutions to these issues or notice any others please let me know! Thanks you.

 

My code:

 

 

package planks;

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;


@ScriptManifest(name = "Planks", author = "regnivon", version = 1.0, info = "", logo = "")
public class Main extends Script {

    Area PlankArea = new Area(2549, 3579, 2556, 3574);
    Area BankArea = new Area(2531, 3576, 2536, 3570);
    private long startTime = System.currentTimeMillis();
    @@Override
    public void onStart() {
       log("hi");
    }
    
    @@Override
    public void onExit() {
        log("bye");
    }

    
    @@Override
    public int onLoop() {
        Entity player = myPlayer();
        GroundItem plank = groundItems.closest("Plank");
        if (inventory.isFull() && !BankArea.contains(player)) {
            getWalking().webWalk(BankArea);
        }
        if (inventory.isFull() && BankArea.contains(player)) {
            if (getBank().isOpen()) {
                getBank().depositAll();
                  new ConditionalSleep(3000,5000) {
                      @@Override
                      public boolean condition() throws InterruptedException {
                          return (!inventory.isFull());
                      }
                  }.sleep();  
            } else {
                Entity box = objects.closest("Bank chest");
                    if (box != null) {
                        box.interact("Use");
                    }
        }
            
        }if (inventory.isEmpty() && !PlankArea.contains(player)) {
            getWalking().webWalk(PlankArea);
        }
        if (plank != null && !inventory.isFull()) {    
            plank.interact("Take");
            return 500;
        }
        return 500;
    }


    @@Override
    public void onPaint(Graphics2D g2d) {
        super.onPaint(g2d);
        g2d.drawString("Elapsed seconds: " + (int) ((System.currentTimeMillis() - startTime) / 1000), 20, 265);
    }


}

 

This is my first real script after doing a few basic ones. I am trying to make a script that collects and deposits planks from the barb outpost. It is currently trying to collect planks even when the inventory is full. It also seems to not want to open the bank. If you have solutions to these issues or notice any others please let me know! Thanks you.

My code:

Well isn't it a deposit box not a bank at the barbarian outpost?

Well isn't it a deposit box not a bank at the barbarian outpost?

 

I think they updated it to a bank (chest).

I think they updated it to a bank (chest).

I c, @op have you tried using getBank().open() ?

Edited by Explv

  • Author

I managed to get it working! I think it might have been a problem with the inventory check, but Im not actually sure because i changed a few things and it started working. Thank you for the help though!

Create an account or sign in to comment

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.