R I F T Posted November 26, 2018 Share Posted November 26, 2018 (edited) I'm writing a sand crab bot and currently writing the logic for checking what spots are available. I've been debugging a null pointer problem I've been getting and it looks like whenever I try and use a method from the MethodProvider class (currently trying log) I get a null pointer. Create an instance of SpotManager passing the RIFTSandCrabs class (my script) ,,, public class RIFTSandCrabs extends Script { ... private SpotManager spotManager = new SpotManager(this); And then in my SpotManager I have this ... public class SpotManager extends MethodProvider { ... private Script RIFTSandCrabs; public SpotManager(Script RIFTSandCrabs) { this.RIFTSandCrabs = RIFTSandCrabs; } ... private void updatePositions() { for (int i = 0; i < crabLocations.length; i++ ) { log(i); updatePosition(crabLocations[i], i); } } private void updatePosition(Position p, int index) { RIFTSandCrabs.stop(false); log("Position coords are " + p.toString()); log("Players located are " + getPlayers()); log("Result of isEmpty() is " + getPlayers().get(p.getX(), p.getY()).isEmpty()); if (getPlayers().get(p.getX(), p.getY()).isEmpty()) { spotStatus[index] = true; } } ... } I pass the instance of my script through to this class only to stop executing at a certain point to check logs etc. What I'm trying to do is make sure the logic I have in place to check if a spot is free is correct and is returning what I want it to return. I get a null pointer at " log(i) " inside the for loop of updatePositions( ). I'm a Java nooblet, so any help would be appreciated EDIT: Solved problem. Resource was in Explvs Tutorial (5). Close please Edited November 26, 2018 by R I F T Solved Quote Link to comment Share on other sites More sharing options...