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.

Hover and burn method!

Featured Replies

Trying to create a basic script to, chop, and the burn the whole inventory of logs. when I use this code, the script wont even start, but if I remove the burnLogs method, it runs fine? also cannot for the life of me figure out how to how the next tree, not asking to be spoonfed, but if someone wants to hop on discord and help me out that would be great!

 

    void cutTree() {
    	if(!getInventory().isFull()) {
        	if(!myPlayer().isAnimating() && tree != null) {
        		tree.interact("Chop Down");
        		new ConditionalSleep(5000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return myPlayer().isAnimating();
                    }
                }.sleep();
        	}
    	}

    }
    
    void burnLogs() {
    	if (!"Tinderbox".equals(getInventory().getSelectedItemName())) {
    	    if (getInventory().isItemSelected()) {
    	        getInventory().deselectItem();
    	    } else {
    	        getInventory().interact("Use", "Tinderbox");
    	    }
    	} else if (getInventory().getItem("logs").interact()) {
    	    new ConditionalSleep(2000) {
    	        @Override
    	        public boolean condition() throws InterruptedException {
    	            return !myPlayer().isAnimating();
    	        }
    	    }.sleep();
    	}
    }

 

11 minutes ago, q600 said:

Trying to create a basic script to, chop, and the burn the whole inventory of logs. when I use this code, the script wont even start, but if I remove the burnLogs method, it runs fine? also cannot for the life of me figure out how to how the next tree, not asking to be spoonfed, but if someone wants to hop on discord and help me out that would be great!


 } else if (getInventory().getItem("logs").interact()) {

 


Isn't it "Logs" not "logs"? That will throw a NullPointerException if the name is incorrect.

To hover the next tree you will need to store the current tree you are chopping. Then find the closest tree that is != the tree you're currently chopping, and call hover() on it.

Edited by Explv

  • Author
35 minutes ago, Explv said:


Isn't it "Logs" not "logs"? That will throw a NullPointerException if the name is incorrect.

To hover the next tree you will need to store the current tree you are chopping. Then find the closest tree that is != the tree you're currently chopping, and call hover() on it.

Yes, good catch there, and what I mean is that the script wont even start, I don't even get a chance to pause or stop it

Where is `tree` defined? Make sure to move the grabbing of objects, NPCs and whatnot into a method rather than in the body of the class as that will cause your script not to start.

 

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.