November 27, 20205 yr 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; }
November 27, 20205 yr @Lol_marcus Try swapping the .isVisible() and null check around in the first if statement. And your sleep condition may also throw an NPE. If it does just change it out with !cRune.Exists()
November 27, 20205 yr Author 7 minutes ago, Gunman said: @Lol_marcus Try swapping the .isVisible() and null check around in the first if statement. And your sleep condition may also throw an NPE. If it does just change it out with !cRune.Exists() Did both and it seems to have stabilized. Thanks for that.
November 28, 20205 yr 7 hours ago, Lol_marcus said: Did both and it seems to have stabilized. Thanks for that. Always null check first, code will read from left to right ^^
Create an account or sign in to comment