Reid Posted June 1, 2014 Share Posted June 1, 2014 Is it just me or is it something with the api? private Condition canPickupBones = new Condition(){ GroundItem bone; @Override public boolean validate() { bone = s.groundItems.closest(526,532); return bone != null && !s.inventory.isFull() && bone.getPosition().distance(s.myPlayer().getPosition()) <= 5 && dFighterGUI.tglbtnBp.isSelected(); } @Override public void execute() throws InterruptedException { bone.interact("Take"); Script.sleep(Script.random(2000)); } }; ERROR : [ERROR][Bot #1][06/01 01:11:14 PM]: Error in script executor! java.lang.NullPointerException at org.dscripts.drunescape.scripts.dFighter$3.validate(dFighter.java:67) at org.dscripts.drunescape.scripts.dFighter.executeScript(dFighter.java:23) at org.dscripts.drunescape.dRunescape.onLoop(dRunescape.java:31) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(zm:105) at java.lang.Thread.run(Unknown Source) Link to comment Share on other sites More sharing options...
Apaec Posted June 1, 2014 Share Posted June 1, 2014 (edited) GroundItem x = this.groundItems.closest(xName); if (x != null && x.exists()) { ammo.interact("Take"); } works fine for me. Edited June 1, 2014 by Apaec Link to comment Share on other sites More sharing options...