July 21, 20169 yr Hello, I'm rewriting my script because I'm using too much WebWalking. WalkingEvent toEdgeBank = new WalkingEvent(edgeBank); toEdgeBank.setOperateCamera(true); toEdgeBank.setEnergyThreshold(50); toEdgeBank.setBreakCondition(new Condition() { @Override public boolean evaluate() { return edgeBank.getRandomPosition().distance(myPlayer()) <= 6; } }).execute(); This is throwing a NullPointer and I have no idea why.
July 21, 20169 yr Author Does "edgeBank" exist? Have you set the Position before running the execute? Area edgeBank = Banks.EDGEVILLE; Thats what I have as a variable for edgeBank do script.execute(event) , not event.execute() That's what I tried before posting this. Still didn't work Edited July 21, 20169 yr by GaetanoH
July 21, 20169 yr Area edgeBank = Banks.EDGEVILLE; Thats what I have as a variable for edgeBank That's what I tried before posting this. Still didn't work getBot().getEventExecutor().execute(EVENT_HERE); this one works for me
July 22, 20169 yr Still can't get it to work... I may be stupid for saying this but what benefit do you get out of using Area edgeBank = Banks.EDGEVILLE; cant you just set the event area as Banks.EDGEVILLE; without storing it? also after setting the conditions i do execute(eventName);
July 22, 20169 yr Author When I'm testing it, it seems that it never gets to setting the condition... Anyone an idea how that comes?
July 22, 20169 yr When I'm testing it, it seems that it never gets to setting the condition... Anyone an idea how that comes? Depends what your code looks like now. In the OP, the snippet posted would throw an nullpointer exception on setting the condition, because of the appended '.execute()'. calling execute on an event always throws NPE, because it is for the EventExecutor's internal use (and the executor sets some vars on the event before calling it). Removing that, there's no way the snippet in the OP can throw an NPE, unless the area is null. Edited July 22, 20169 yr by FrostBug
July 22, 20169 yr Author Depends what your code looks like now. In the OP, the snippet posted would throw an nullpointer exception on setting the condition, because of the appended '.execute()'. calling execute on an event always throws NPE, because it is for the EventExecutor's internal use (and the executor sets some vars on the event before calling it). Removing that, there's no way the snippet in the OP can throw an NPE, unless the area is null. Walking to the fishing spot works now, however walking back to the bank doesn't. WalkingEvent toEdgeBank = new WalkingEvent(Banks.EDGEVILLE); toEdgeBank.setOperateCamera(true); toEdgeBank.setEnergyThreshold(50); toEdgeBank.setBreakCondition(new Condition() { @Override public boolean evaluate() { return Banks.EDGEVILLE.getRandomPosition().distance(myPlayer()) <= 6; } }); getBot().getEventExecutor().execute(toEdgeBank);
July 22, 20169 yr Walking to the fishing spot works now, however walking back to the bank doesn't. WalkingEvent toEdgeBank = new WalkingEvent(Banks.EDGEVILLE); toEdgeBank.setOperateCamera(true); toEdgeBank.setEnergyThreshold(50); toEdgeBank.setBreakCondition(new Condition() { @Override public boolean evaluate() { return Banks.EDGEVILLE.getRandomPosition().distance(myPlayer()) <= 6; } }); getBot().getEventExecutor().execute(toEdgeBank); Nothing wrong with that code as far as I can tell. So it's probably not reached. Try logging Also, in WalkingEvent you can use setMinDistanceThreshhold(6) instead of breaking at a radius of 6 Also, since this is the LocalWalker, make sure the position is actually loaded :E Otherwise nothing's gonna happen. Edited July 22, 20169 yr by FrostBug
July 22, 20169 yr Author Nothing wrong with that code as far as I can tell. So it's probably not reached. Try logging Also, in WalkingEvent you can use setMinDistanceThreshhold(6) instead of breaking at a radius of 6 Also, since this is the LocalWalker, make sure the position is actually loaded :E Otherwise nothing's gonna happen. Removing the condition somehow got it working. Gonna try a few more times. Nothing wrong with that code as far as I can tell. So it's probably not reached. Try logging Also, in WalkingEvent you can use setMinDistanceThreshhold(6) instead of breaking at a radius of 6 Also, since this is the LocalWalker, make sure the position is actually loaded :E Otherwise nothing's gonna happen. What do you mean by loading the position?
Create an account or sign in to comment