Jump to content

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


Recommended Posts

Posted

[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.

Posted

[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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...