Bobrocket Posted May 25, 2015 Share Posted May 25, 2015 (edited) So, for part of my quest bot it has to fill a bucket of milk. Code: /* Go to dairy cows if we have a bucket */ if (hasItem("Bucket")) { walkTo(placesToGo[2]); sleep(750); /* Open the gate if needed */ Entity gate = closestEntity("Gate"); openDoor(gate); /* Milk the cow */ Entity cow = closestEntity("Dairy cow"); if (cow != null && cow.isVisible()) { moveCamera(cow); sleep(750); cow.interact("Milk"); new ConditionalSleep(750000) { @Override public boolean condition() { return parent.getInventory().contains(itemsNeeded[1]); } }.sleep(); } sleep(750); } For some reason, the bot will not walk from lumbridge castle to dairy cows. Is there any reason for this? Edited May 25, 2015 by Bobrocket Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 26, 2015 Share Posted May 26, 2015 It seems a bit silly to ask us about a walkTo method that you seemingly wrote yourself, and haven't provided the source for in this post. If however it uses some of the standard localWalker or WalkingEvent API, then the pathfinding is limited to the currently loaded region. Also, offtopic, but sequential execution like that is quite bad. Try to set it up to not rely on the previous action to have completed successfully. Easily done by ensuring that only 1 thing is done in every loop cycle. Quote Link to comment Share on other sites More sharing options...
Bobrocket Posted May 26, 2015 Author Share Posted May 26, 2015 It seems a bit silly to ask us about a walkTo method that you seemingly wrote yourself, and haven't provided the source for in this post. If however it uses some of the standard localWalker or WalkingEvent API, then the pathfinding is limited to the currently loaded region. Also, offtopic, but sequential execution like that is quite bad. Try to set it up to not rely on the previous action to have completed successfully. Easily done by ensuring that only 1 thing is done in every loop cycle. Sorry, I forgot to say here but the walkTo method is just localWalker.walkTo(position) and then a conditional sleep until the player is no longer moving. I am going to make sure that I am not using sequential execution later, as right now this is just a test to ensure that everything actually works. So how am I going to get my bot to walk there? Is there any way I could generate a path there? Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 26, 2015 Share Posted May 26, 2015 If you do have a path, you could just keep walking to the loaded position closest to your target destination. As you reach that position the next regions should load. Also, localWalker walk methods aren't asynchronous, so there shouldn't be a need for a conditional sleep after invoking it. Quote Link to comment Share on other sites More sharing options...
Bobrocket Posted May 26, 2015 Author Share Posted May 26, 2015 If you do have a path, you could just keep walking to the loaded position closest to your target destination. As you reach that position the next regions should load. Also, localWalker walk methods aren't asynchronous, so there shouldn't be a need for a conditional sleep after invoking it. I see, thank you. I know that localWalker is synchronous but I have that there because sometimes my client would lag a bit and would try to do the next bit without finishing walking so I added that check. Quote Link to comment Share on other sites More sharing options...