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.

Console spams all my scripts with the same issue, not sure what's wrong.

Featured Replies

[ERROR][bot #1][02/27 09:44:04 PM]: Error in script executor!
java.lang.NullPointerException
    at BirdHunter.onLoop(BirdHunter.java:43)
    at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ml:189)
    at java.lang.Thread.run(Unknown Source)

is the issue.

All my scripts work fine, it's just that gets spammed 24/7 every second.

import java.awt.*;

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

@ScriptManifest(author = "twin 763", info = "Crimson Swift Catcher", name = "Crimson Catcher", version = 1, logo = "")
public class BirdHunter extends Script {

	@Override
	public void onStart() {
		log("Crimson Hunter by twin 763");
		log("Let me know on my forum post any issues you've had");
		log("Enjoy the easy levels!");
	}
	Area HUNTING_AREA = new Area(2618,2940,2597,2912);
	private enum State {
		LAY, CHECK, PLACE, DROP,DISMANTLE
	};

	private State getState() {
		Entity snare = objects.closest("Bird snare");
		GroundItem snareOnFloor = groundItems.closest("Bird snare");
		Entity brokenSnare = objects.closest(9344);
		if (inventory.isFull())
			return State.DROP;
		if (snareOnFloor != null)
			return State.LAY;
		if(snare==null&&snareOnFloor == null&&brokenSnare==null)
			return State.PLACE;
		if (snare.hasAction("Check"))
			return State.CHECK;
		if(brokenSnare!=null)
			return State.DISMANTLE;
		return null;
	}

	@Override
	public int onLoop() throws InterruptedException {
		if (!HUNTING_AREA.contains(myPlayer())) { 
		    log("Returning to Hunting Area");
		    localWalker.walk(HUNTING_AREA.getRandomPosition(0)); 
		}
		switch (getState()) {
		
		case LAY:
			GroundItem snareOnFloor = groundItems.closest("Bird snare");
			if (snareOnFloor != null) {
				snareOnFloor.interact("Lay");
				sleep(random(2000,3000));
			}
			break;
		case DROP:
			inventory.dropAllExcept("Bird snare", "Coins");
			break;
		case PLACE:
			inventory.interact("Lay","Bird snare" );
			sleep(random(2500,3000));
			break;
		case CHECK:
			Entity snare = objects.closest("Bird snare");
			if(snare.hasAction("Check"))
				snare.interact("Check");
			sleep(random(2000,3000));
			break;
		case DISMANTLE:
			Entity brokenSnare = objects.closest(9344);
				if(brokenSnare!= null)
					brokenSnare.interact("Dismantle");
				sleep(random(2000,3000));
			break;
		}		
		
		
		return random(200, 300);
	}

	@Override
	public void onExit() {
		log("Thanks for using my script! Report any issues to me on the forum!");
	}

	@Override
	public void onPaint(Graphics2D g) {

	}

}

Everything in there works fine, it's just my console is getting spammed and I can't figure out why.

[ERROR][bot #1][02/27 09:44:04 PM]: Error in script executor!

java.lang.NullPointerException

    at BirdHunter.onLoop(BirdHunter.java:43)

    at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ml:189)

    at java.lang.Thread.run(Unknown Source)

is the issue.

All my scripts work fine, it's just that gets spammed 24/7 every second.


Everything in there works fine, it's just my console is getting spammed and I can't figure out why.

Java.lang.NullPointerException
    at BirdHunter.onLoop(BirdHunter.java:43)

Something on line 43 is returning null so the script cant work with it

  • Author
Java.lang.NullPointerException
    at BirdHunter.onLoop(BirdHunter.java:43)

Something on line 43 is returning null so the script cant work with it

 

 

ahh found the issue, just made a wait case instead of having it return null. Thank you!

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.