Jump to content

Why is this code lagging/crashing my script?


Recommended Posts

Posted

As soon as it collects the chaos rune, it starts lagging and giving null point exception errors. I have NO idea why. Can anyone shed some light please? :/

	@Override
	public int onLoop() throws InterruptedException {

		GroundItem cRune = getGroundItems().closest("Chaos rune");

		if (cRune.isVisible() && cRune != null) {
			cRune.interact("Take");
			Sleep.sleepUntil(() -> !cRune.isVisible(), 1000);
		} else {
			getWorlds().hopToF2PWorld();
			sleep(random(500, 1500));
		}
		return 700;
	}

 

  • Like 1

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