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.

New To Scripting, Need Help!

Featured Replies

I thought I'd give scripting a try so that I may provide others in the community with working scripts, but I can't even get my first prototype working. I got this in the terminal:
 
[ERROR][10/24 10:32:34 AM]: Failed to start script [zWoodcutter]
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.osbot.com2.run(yn:198)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
 
What does this mean? How do I solve it? Here's my code:
 
package Woodcutter;

import java.awt.Graphics2D;

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


@ScriptManifest(author = "Zulfe", info = "Chops Yews at Edgeville", logo = "N/A", name = "zWoodcutter", version = 1.0) 
public abstract class Woodcutter extends Script {
	
	//code to be executed at the start of script
	@Override
	public void onStart(){
		log("Starting de script");
	}
	
	private enum State {
		CHOP, BANK, WAIT;
	};
	
	private State getState() {
		if(!(inventory.isFull()))
			return State.CHOP;
		if(inventory.isFull())
			return State.BANK;
		return State.WAIT;
		
	}
	
	@Override
	public int onLoop() throws InterruptedException{
		switch (getState()) {
		case CHOP:
			Entity willowTree = objects.closest("Tree");
			if (willowTree != null)
				willowTree.interact("Chop down");
			break;
			
		case BANK:
			if (inventory.isFull()){
				inventory.dropAll();
				
			}
			break;
			
		case WAIT:
			sleep(random(500, 700));
			break;
		}
		return 50;
	}
	
	//code to be executed at the end
	@Override
	public void onExit(){
		
	}
	
	@Override
	public void onPaint(Graphics2D g){
		
	}

}

 

Guest
This topic is now closed to further replies.

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.