August 15, 20178 yr So I have an error that I can't seem to solve, I'm probably overlooking it.. Error in script executor! java.lang.NullPointerException at Main.getState(Main.java:118) at Main.onLoop(Main.java:143) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(un:19) at java.lang.Thread.run(Unknown Source) Lines 118 onward: else if (!getBank().isOpen() && currentamulet.getId() == 1704 || inventory.contains(1704) && Banks.EDGEVILLE.contains(myPlayer())) { myPlayer().getMethods().getEquipment().interact(EquipmentSlot.AMULET,"Remove"); sleep(random(600,1000)); return State.NO_GLORY; }
August 15, 20178 yr 10 minutes ago, OllieW said: So I have an error that I can't seem to solve, I'm probably overlooking it.. Error in script executor! java.lang.NullPointerException at Main.getState(Main.java:118) at Main.onLoop(Main.java:143) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(un:19) at java.lang.Thread.run(Unknown Source) Lines 118 onward: else if (!getBank().isOpen() && currentamulet.getId() == 1704 || inventory.contains(1704) && Banks.EDGEVILLE.contains(myPlayer())) { myPlayer().getMethods().getEquipment().interact(EquipmentSlot.AMULET,"Remove"); sleep(random(600,1000)); return State.NO_GLORY; } Probably currentamulet is null. Please group your logic together; you're shooting yourself in the foot by mixing different logical operators without grouping them. It also looks like you've misunderstood the framework you're using, seeing as you're performing interactions in a method called getState; I would consider going over it again.
August 15, 20178 yr Author 4 minutes ago, FrostBug said: Probably currentamulet is null. Please group your logic together; you're shooting yourself in the foot by mixing different logical operators without grouping them. It also looks like you've misunderstood the framework you're using, seeing as you're performing interactions in a method called getState; I would consider going over it again. Thanks for the tips and the feedback, you're right. This script is a complete mess to be honest.
August 15, 20178 yr 47 minutes ago, OllieW said: Thanks for the tips and the feedback, you're right. This script is a complete mess to be honest. You'll get there buddy
Create an account or sign in to comment