Skip 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.

Chop and Burn

Featured Replies

Hi all! I was wondering if somebody could help me with my script. It chops trees alright but once the inventory is full it will not light them.

 


import java.awt.Graphics2D;

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



@ScriptManifest(author = "Tias", info = "Cuts trees and burns logs", name = "Choppy and Burny", version = 0, logo = "")
public class Main extends Script {

    @Override
    public void onStart() {
        log("Let's get started!");
    }

    @Override
    public int onLoop() throws InterruptedException {

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


        RS2Object tree = getObjects().closest(obj -> obj != null && obj.getName().equals("Tree") && getMap().canReach(obj)); //What tree to chop.
        if (!myPlayer().isAnimating() && !getInventory().isFull()) {
            if (tree != null) {
                if (tree.interact("Chop down")) {
                    new ConditionalSleep(5000, 2000) {
                        @Override
                        public boolean condition() throws InterruptedException {
                            return false;
                        }
                    }.sleep();
                }
            }

            else if (tree == null) {  //If it doesn't see a tree it moves the camera and then moves.
                Area treeArea = new Area(3143, 3239, 3198, 3205);
                getCamera().toEntity(tree);
                log("Searching for a tree...");
                if (getWalking().webWalk(treeArea)) {
                    log("Walking to trees...");
                    new ConditionalSleep(5000, 6000) {
                        @Override
                        public boolean condition() throws InterruptedException {
                            return false;
                        }
                    };
                }
            }
            else if (getInventory().isFull()) {
                log("Burning  logs");
                while (inventory.contains("Logs")) {
                    log("looop");

                    if (inventory.isItemSelected()) { inventory.deselectItem(); }

                    if(!(myPlayer().isAnimating()) && inventory.interact("Use", "Tinderbox")) {
                        if (inventory.isItemSelected() && inventory.interactWithNameThatContains("Use", "Logs")) {
                            new ConditionalSleep(3000) {
                                @Override
                                public boolean condition() {
                                    return (myPlayer().isAnimating());
                                }
                            }.sleep();
                        }
                    }
                }
            }
        }

        return random(200, 300);
    }

    @Override
    public void onExit() {
        log("Thanks for running!");
    }

    @Override
    public void onPaint(Graphics2D g) {

    }

}

 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.