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.

YewChopper (Randomly logged out)

Featured Replies

So made a Yew chopping script that chops and banks yew logs. For some odd reason the bot logged out twice now that I've been running it. The first time I got this error in the Logger:

 

Spoiler

[INFO][Bot #1][04/18 11:28:46 AM]: Script WillowChopper has exited!
[ERROR][Bot #1][04/18 11:28:46 AM]: Error on random solver onLoop() : Auto Login
java.lang.InterruptedException: sleep interrupted
    at java.lang.Thread.sleep(Native Method)
    at org.osbot.rs07.event.RandomExecutor.run(pg:178)
    at java.lang.Thread.run(Unknown Source)

The second time the Logger didn't produce an error. Anyone know why this would happen? Currently running script to see if problem reoccurs.

Code:

Spoiler

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

@ScriptManifest(author = "Imthabawse", info = "Chops N Drops willow logs for gains", logo = "", name = "WillowChopper", version = 1)


public class WillowChopper extends Script {


    private Area yewArea = new Area(2751, 3436, 2769, 3425);


    private void chop() throws InterruptedException {
        Entity yew = getObjects().closest(yewArea,"Yew");
        Entity nest = getGroundItems().closest("Bird nest");

        if(!myPlayer().isAnimating() && !myPlayer().isMoving() && !getInventory().isFull() && yew != null && nest == null) {
            log("Chopping tree...");
           sleep(random(200,400));
            yew.interact("Chop down");
            new ConditionalSleep(5500) {
                @Override
                public boolean condition() {
                    return myPlayer().isAnimating() || !yew.exists() ;
                }
            }.sleep();
        sleep(random(500,800));
        log("Moving mouse off-screen...");
        getMouse().moveOutsideScreen();
        }
    }

    private void bank() throws InterruptedException {
        if(getInventory().isFull() && !myPlayer().isAnimating() && !myPlayer().isMoving()) {
            sleep(random(400,800));
            log("Walking to bank...");
            getWalking().webWalk(Banks.CATHERBY);
            sleep(random(400,800));
            log("Opening bank..");
            getBank().open();
            log("Depositing logs...");
            getBank().depositAll("Yew logs","Bird nest");
            sleep(random(400,800));
            log("Closing bank..");
            getBank().close();
        }
    }

    private void nest() throws InterruptedException {
        Entity nest = getGroundItems().closest("Bird nest");

        if(nest != null && !getInventory().isFull()) {

            sleep(random(600,900));
            log("Picking up Birds nest..");
            nest.interact("Take");
        }
    }


    @Override
    public void onStart() {
        getCamera().toTop();
        log("Welcome to YewChopper! Enjoy the EXP!");
    }

    @Override
    public void onExit() {
        log("Thanks for using YewChopper :)");
    }

    @Override
    public int onLoop() throws InterruptedException {
if(yewArea.contains(myPlayer()) && !getInventory().isFull()) {
    chop();
    nest();
}else if(!yewArea.contains(myPlayer()) && !getInventory().isFull()) {
    log("Let's get back to chopping!");
    getWalking().webWalk(yewArea);
        }else{
        bank();
}

        return 500;
    }
}

Edit: Bot logged out in the middle of chopping.. nothing in logger script still running.

Edited by Imthabawse

The bot has been cutting trees (no input = idle) for 5? minutes causing it to get logged out for being idle.

  • Author
On 4/18/2019 at 3:59 PM, dazeldo said:

The bot has been cutting trees (no input = idle) for 5? minutes causing it to get logged out for being idle.

Removed my dumb comment haha

Edited by Imthabawse
Im dumb

12 minutes ago, Imthabawse said:

So you're saying because I haven't manually interacted with the bot within 5 minutes it's logging out? Not really sure what you're saying here but the bot will run fine for awhile chopping yew's and banking then randomly log's out. Haven't tinkered with it yet but I'll get to the bottom of it :]

Edit: Where'd you get 5 minutes from anyhow?

If your not in combat you have to click before 5 minute timer kicks you out, if you are in combat i think its 20 minutes, but it could be 15.

  • Author
6 minutes ago, FuryShark said:

If your not in combat you have to click before 5 minute timer kicks you out, if you are in combat i think its 20 minutes, but it could be 15.

Ah I see. Haven't ran into this problem before. 

Thanks @dazeldo sorry for confusion lol and @FuryShark for clearing that up.

Edited by Imthabawse

  • Author

Currently testing this ?

Spoiler

private void idleTest() throws InterruptedException {
   Entity yewTree = getObjects().closest("Yew");

    if (!getMouse().isOnScreen()) {
        log("Idle to long.. Interacting with tree.");
        sleep(random(240000,245000));
        yewTree.interact("Chop down");


    }
}

Gonna let it run for awhile see if it works or not. 

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.