trainux Posted May 9, 2018 Share Posted May 9, 2018 attempt to interact in the following way: RS2Object fish_pot = getObjects().closest("Fishing spot"); fish_pot.interact("Small Net"); and I get the following error: [ERROR][Bot #1][05/09 02:23:35 PM]: Error in script executor! java.lang.NullPointerException at Scripts.Bot.onLoop(Bot.java:479) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ph:114) at java.lang.Thread.run(Unknown Source) Quote Link to comment Share on other sites More sharing options...
Night Posted May 9, 2018 Share Posted May 9, 2018 getObjects().getClosest() can return a null object, I'd recommend trying some Java tutorials to learn about NPEs. Quote Link to comment Share on other sites More sharing options...
Hannes7337 Posted May 9, 2018 Share Posted May 9, 2018 (edited) Hey man, try this: if(fish_spot != null){ fish_spot.interact("Small Net"); } Btw: I think fish spots are npcs instead of rs2objects , but i'm not sure Edited May 9, 2018 by Hannes7337 Quote Link to comment Share on other sites More sharing options...
Deceiver Posted May 9, 2018 Share Posted May 9, 2018 fishing spots are npcs Quote Link to comment Share on other sites More sharing options...
Muffins Posted May 9, 2018 Share Posted May 9, 2018 55 minutes ago, Deceiver said: fishing spots are npcs Quote Link to comment Share on other sites More sharing options...
trainux Posted May 9, 2018 Author Share Posted May 9, 2018 oh! interesting are NPC. Thank you all. Quote Link to comment Share on other sites More sharing options...
01053 Posted May 10, 2018 Share Posted May 10, 2018 5 hours ago, trainux said: oh! interesting are NPC. Thank you all. Yes, and make sure you do your null check. final NPC fishingSpot = script.getNpcs().closest("Fishing spot"); if (fishingSpot != null) fishingSpot.interact("Small net"); Quote Link to comment Share on other sites More sharing options...