H0ppy Posted July 2, 2013 Posted July 2, 2013 (edited) Hello, I've made a TilePath class very fast to walk some distances by walking on tilepaths: CODE: import org.osbot.script.Script; import org.osbot.script.rs2.map.Position; public class TilePath { private Script script; private Position[] path; private int[] distance; public TilePath(Script s, Position[] pos) { script = s; path = pos; distance = new int[path.length]; } public void traverse() throws InterruptedException { initPath(); script.walk(getNextPos()); } private Position getNextPos() { Position pos = null; for (int i = (path.length - 1); i >= 0; i++) { if (distance[i] < 15) { return path[i]; } } return pos; } private void initPath() { for (int i = 0; i < path.length; i++) { distance[i] = script.realDistance(path[i]); } } } So now you can easy do: Position[] testpath = {new Position(3012,3357,0),new Position(3007,3354,0),new Position(3007,3331,0)}; TilePath path = new TilePath(this, testpath); path.traverse(); Pretty easy to use and its walks very smooth.Kind regardsH0ppy Edited July 5, 2013 by H0ppy
Doout Posted July 3, 2013 Posted July 3, 2013 private void initPath() { for (int i = 0; i < path.length; i++) { distance[0] = script.realDistance(path[0]); } } ? 1
H0ppy Posted July 5, 2013 Author Posted July 5, 2013 private void initPath() { for (int i = 0; i < path.length; i++) { distance[0] = script.realDistance(path[0]); } } ? My bad. I typed some manually in here -_-
H0ppy Posted July 5, 2013 Author Posted July 5, 2013 (edited) So your other code was generated? generated from where? some AI robot I made? what a question ... No i copied a piece of it and manaully typed the last part becaus ei didn't copied it whole by accident... wow man. Like you never make mistakes ... You so hostile. Just because i turned down your offer to make tutorials together? grtz hoppy Edited July 5, 2013 by H0ppy
Joseph Posted July 6, 2013 Posted July 6, 2013 generated from where? some AI robot I made? what a question ... No i copied a piece of it and manaully typed the last part becaus ei didn't copied it whole by accident... wow man. Like you never make mistakes ... You so hostile. Just because i turned down your offer to make tutorials together? grtz hoppy Could you explain to me how to add this into my script, because this walking is killing me -.-"
haskabab Posted July 7, 2013 Posted July 7, 2013 Could you explain to me how to add this into my script, because this walking is killing me -.-" I would also like to know how to actually implement this.
H0ppy Posted July 7, 2013 Author Posted July 7, 2013 The code inside the spoiler is a class.Just make a new class inside your IDE and paste that code in it.Then in your main class you can create an object of it.Like the example above.Also check this thread: (good walking)http://osbot.org/forum/topic/6283-aio-walking-class-doenst-glitch-on-break/ grtzH0ppy