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.

Cant get scripts to run

Featured Replies

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;

@ScriptManifest(author = "H", info = "My Willow Cutter", name = "H", version = 0.1, logo = "")
public class main extends Script {

	@Override
	public void onStart() {
		log("Welcome to my simple willow cutter");
	}

	private enum State {
		CUT, DROP, WAIT
	};

	private State getState() {
		Entity tree = objects.closest("Willow");
		if (!inventory.isEmpty())
			return State.DROP;
		if (tree != null)
			return State.CUT;
		return State.WAIT;
	}

	@Override
	public int onLoop() throws InterruptedException {
		log("Loop reached");
		switch (getState()) {
		case CUT:
			Entity tree = objects.closest("Willow");
			if (tree != null) {
				tree.interact("Chop down");
			}
			break;
		case DROP:
			inventory.dropAll();
			break;
		case WAIT:
			sleep(random(500, 700));
			break;
		}
		return random(200, 300);
	}

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

	@Override
	public void onPaint(Graphics2D g) {

	}

} 

I recently started scripting again and thought I would try and make a simple woodcutter as practice. However no matter what I do my osbot does not seem to want to run scripts. This is the code I came up with for my willow cutter, nothing special at all. I am using the latest version 2.3.106. The same happens with all of the free woodcutting scripts as well. Any ideas as to what the problem could be?

 

Edit: Before anyone asks, I am using the latest version of java, eclipse etc... and I am exporting as a jar file to the osbot scripts folder as well as adding the osbot jar to the build path in my project.

Edited by hunterl31

Are there any errors being output to the OSBot console? You enable the console in the top right where the interaction lock and settings etc are.

Edited by omni4life

I'm experiencing the same problem. I've written 3 scripts of my own, which were running completely fine just a few days ago. Now, it won't print anything when I try to log on entry to onStart() or onLoop(). The onExit() message is still printed tho, which is what I find even weirder.

 

No errors are printed to the console.

 

I've even tried stripping the code down to just

@ScriptManifest(author = "Verify", info = "SimpleTest", name = "HelloTester", version = 0, logo = "")
public class main extends Script{

    @Override
    public void onStart() {
        log("Hello, welcome to swordfish swordies service!");
       
    }

	
    @Override
    public int onLoop() throws InterruptedException {
    	log("Looping");
        return random(300, 500);
    }
    
    @Override
    public void onExit() {
        log("Goodbye.");
    }
 
    @Override
    public void onPaint(Graphics2D g) {
 
    }
}

Additional things I've tried to resolve it:

  1. Delete all scripts from osbot folder and export them again.
  2. Delete the entire osbot folder from my user directory.
  3. Running a purchased SDN script (Perfect crabs to be specific)

So far no success tho. Any help would be appreciated.

Edited by Verify

I was able to fix it, by uninstalling all Java versions, deleting all OSBot settings. Then reinstalling 32 bit java (I had 64 bit previously), and redownloading osbot.

 

I would try reinstalling java, and switching to 32 bit if you had 64 bit.

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.