H0rn Posted August 15, 2017 Share Posted August 15, 2017 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; } Quote Link to comment Share on other sites More sharing options...
FrostBug Posted August 15, 2017 Share Posted August 15, 2017 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. 1 Quote Link to comment Share on other sites More sharing options...
H0rn Posted August 15, 2017 Author Share Posted August 15, 2017 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. Quote Link to comment Share on other sites More sharing options...
GaetanoH Posted August 15, 2017 Share Posted August 15, 2017 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 Quote Link to comment Share on other sites More sharing options...
Chris Posted August 15, 2017 Share Posted August 15, 2017 dont use states Quote Link to comment Share on other sites More sharing options...