Satire Posted December 8, 2016 Share Posted December 8, 2016 (edited) So I was thinking about doing if(!area.contains(myplayer()) it'll walk back to the area. For some random reason, banking works fine but when I play my script at a bank with a full inv of food, when the check should be true, it just stays there on waiting.... Let's say I finished a task that is in lumby and my fighting area was in edgeville or varrock, after the task is complete, it should walk back to where it was fighting. Also how would I use webwalking without getting [ERROR][bot #1][12/07 10:59:49 PM]: Error in script executor! java.lang.NullPointerException at main.Banking(main.java:108) at main.onLoop(main.java:370) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(qh:103) at java.lang.Thread.run(Unknown Source) This only happens when it keeps spamming the webwalker. It says "your destination is complete" , opens the bank then spams that error. I think it's because I have a state called WALKING and it keeps spamming the webwalker. I thought the webwalker is a whole function that walks to the area then stops then continues running down the lines and completeing the task. For example getWalking().webWalk(banks); if(!getBank().open()){ getBank().open(); sleep(2500); getBank().depositAll(); } getWalking().webWalk(trainingarea); Works like a charm but when I do this my check if(inventoryisfull && playerisnotinarea){ return State.WALKING; -------------------------------------------------------- //when case = walking if(selectedArea.equals("Edgeville Rats")){ getWalking().walk(new Position(3237,9866,0)); then it calls walkToDArea(); which basically walks to an area which contains string of x so I think the 2 webwalking instances are clashing on another or something. I can tell that everything works without webwalking (cause I've tested it). It's only when webwalking is called, this happens. EDIT: Seems like WalkToDArea is the cause of those errors. I will re-write it and hopefully it'll work.... EDIT2: Seems to be happening when banking is called. No idea what's wrong with that, as banking was working yesterday! EDIT3: SOLVED! Edited December 8, 2016 by lol0 Quote Link to comment Share on other sites More sharing options...
Fly Posted December 8, 2016 Share Posted December 8, 2016 I would add in a public enum State, and add in WALK_TO_BANK, WALK_TO_WHATEVER.. public int onLoop() throws InterruptedException { log("Loop"); currentState = getState(); switch (currentState) { case WALK_TO_BANK: getWalking().webWalk(Banks.LUMBRIDGE_UPPER); break; ^^ I use that for a basic woodcuting scripts, work perfectly.. Quote Link to comment Share on other sites More sharing options...
Satire Posted December 8, 2016 Author Share Posted December 8, 2016 (edited) I would add in a public enum State, and add in WALK_TO_BANK, WALK_TO_WHATEVER.. public int onLoop() throws InterruptedException { log("Loop"); currentState = getState(); switch (currentState) { case WALK_TO_BANK: getWalking().webWalk(Banks.LUMBRIDGE_UPPER); break; ^^ I use that for a basic woodcuting scripts, work perfectly.. That won't work without very detailed arguments. Let's say I started the script with a full inventory of food or let's say I finished buying an item from GE, it doesn't want to walk back to the designated area. Ontop of that, something is causing my web walking to go null.... Here is my Walktoarea private void walkToDArea(){ if(selectedArea.equals("Edgeville Rats")){ getWalking().walk(new Position(3237,9866,0)); }else if(selectedArea.equals("Chickens")){ getWalking().webWalk( new Position(3189,3278,0)); } It should walk back but it doesn't.... It throws me an error or just stands and says waiting. It gets called when the state is Walking (if inv is full of food) Edited December 8, 2016 by lol0 Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 8, 2016 Share Posted December 8, 2016 getWalking().webWalk(banks); if(!getBank().open()){ getBank().open(); sleep(2500); getBank().depositAll(); } getWalking().webWalk(trainingarea); Why are you not checking if inventory is full before depositing? Also, you aren't checking before you walk back to the training area. If you fail to open the bank, it will just start walking back to the trainingarea. Make sure to check every single action you do incase you fail. Quote Link to comment Share on other sites More sharing options...
Satire Posted December 8, 2016 Author Share Posted December 8, 2016 getWalking().webWalk(banks); if(!getBank().open()){ getBank().open(); sleep(2500); getBank().depositAll(); } getWalking().webWalk(trainingarea); Why are you not checking if inventory is full before depositing? Also, you aren't checking before you walk back to the training area. If you fail to open the bank, it will just start walking back to the trainingarea. Make sure to check every single action you do incase you fail. I have a check before hand for the inventory. But I see what you mean for that second check. I've added that in. But it doesn't matter because I still get the errors for whatever reason... Quote Link to comment Share on other sites More sharing options...