MassRS Posted January 17, 2016 Share Posted January 17, 2016 So when i wrote my script but when it's up and running after some time it starts lagging really bad and gives this error in the logger: [ERROR][Bot #1][01/17 07:46:41 PM]: Error in script executor! java.lang.NullPointerException at mWyverns.getState(mWyverns.java:134) at mWyverns.onLoop(mWyverns.java:142) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(qf:131) at java.lang.Thread.run(Unknown Source) at line 134 i have this: GroundItem bone = getGroundItems().closestThatContains("potion","Clue", "Adamant", "Granite", "Uncut", "key", "logs", "Runite", "battlestaff", "Rune", "Dragon", "Snapdragon", "Ranarr", "bar", "Draconic","bones"); if (bone.isOnScreen()) return State.LOOT; Quote Link to comment Share on other sites More sharing options...
demmonic Posted January 17, 2016 Share Posted January 17, 2016 If I had to guess, you're not checking if bone is null (i.e. an item exists with one of those names.) if (bone != null && bone.isOnScreen()) 1 Quote Link to comment Share on other sites More sharing options...
itzDot Posted January 17, 2016 Share Posted January 17, 2016 you also need to null check bone != null 1 Quote Link to comment Share on other sites More sharing options...
Explv Posted January 17, 2016 Share Posted January 17, 2016 java.lang.NullPointerException You should probably learn what that means.. 3 Quote Link to comment Share on other sites More sharing options...
MassRS Posted January 17, 2016 Author Share Posted January 17, 2016 If I had to guess, you're not checking if bone is null (i.e. an item exists with one of those names.) if (bone != null && bone.isOnScreen()) you also need to null check bone != null thanks guys, seems to work Quote Link to comment Share on other sites More sharing options...