Popymon24 Posted July 31, 2016 Posted July 31, 2016 I'm writing a woodchopping script that banks, and I need to get my character from the woodchopping area (position 1) to the bank (position 2). How would I go about having my character walk between the two points; what command would let me input an end position and have my character walk there?
Typhome Posted July 31, 2016 Posted July 31, 2016 (edited) http://osbot.org/api/org/osbot/rs07/api/Walking.html#Walking-- getWalking().walk(new Position(0, 0, 0)); Edited July 31, 2016 by Typhome
RamSkulls Posted July 31, 2016 Posted July 31, 2016 http://osbot.org/api/org/osbot/rs07/api/Walking.html#Walking-- getWalking().walk(new Position(0, 0, 0));
Team Cape Posted July 31, 2016 Posted July 31, 2016 (edited) I'm writing a woodchopping script that banks, and I need to get my character from the woodchopping area (position 1) to the bank (position 2). How would I go about having my character walk between the two points; what command would let me input an end position and have my character walk there? http://osbot.org/forum/topic/100862-bank-closest-to-entity/ ^ This is a very useful snippet from @LoudPacks that allows you to get the bank closest to your player. I just input the enum privately inside of a class called 'Banker' and made the methods of the enum into methods of the class. Seems like you're new, so here's a great resource that @Explv made that has been incredibly useful to me since I found it. http://explv.github.io/ <-- Gets you the positions for Areas, Positions, etc. Very useful. private Area myBank; private Position initialPos; //have them start the script in the right location. //Or you could just input an Area if your script is already centered in a specific location private final Area wcArea = new Area(8, 9, 10, 11); @[member='OverRideCwalk'] public void onStart() { myBank = new Banker().closestTo(myPlayer()); initialPos = myPlayer().getPosition(); } @[member='OverRideCwalk'] public void onLoop() throws InterruptedException { getWalking().walk(myBank.getRandomPosition(); //walk to closest bank //~~~~~~~~~ banking code to implement ~~~~~~~~~~ getWalking().walk(initialPos); //or if you want to walk back to an area: getWalking().walk(wCArea.getRandomPosition()); } Edited July 31, 2016 by Imateamcape
Juggles Posted July 31, 2016 Posted July 31, 2016 (edited) //Make 2 areas private final Area WoodCut = new Area(0,1,2,3); private final Area Bank = new Area(4,5,6,7); if (getInventory.isFull) { if (!Bank.contains(myPlayer) { getWalking.webWalk(Bank); } else { //BankCode } if (!getInventory.isFull) { if (!WoodCut.contains(myPlayer) { getWalking.webWalk(Woodcut); } else { //Chop } Edited July 31, 2016 by lg_juggles
Popymon24 Posted July 31, 2016 Author Posted July 31, 2016 It's now fully working! Thank you all for the support! 1