iJodix Posted May 5, 2016 Share Posted May 5, 2016 (edited) So if i have current loaded region tiles loaded into a list, how am i supposed to generate a straight path(ignoring objects) to npc using those tiles ? Someone told me to use A* algorithm but i have no ideas where to start, welps ? Edited May 5, 2016 by iJodix Quote Link to comment Share on other sites More sharing options...
Diclonius Posted May 5, 2016 Share Posted May 5, 2016 Is generating the path yourself necessary? Couldn't you just the OSBot's walking/webwalking i.e. walking.webWalk(position) or walking.walk(position) Quote Link to comment Share on other sites More sharing options...
iJodix Posted May 5, 2016 Author Share Posted May 5, 2016 Is generating the path yourself necessary? Couldn't you just the OSBot's walking/webwalking i.e. walking.webWalk(position) or walking.walk(position) I would've not posted if it wasn't necessary. Quote Link to comment Share on other sites More sharing options...
Token Posted May 5, 2016 Share Posted May 5, 2016 What is this used for? Quote Link to comment Share on other sites More sharing options...
Botre Posted May 5, 2016 Share Posted May 5, 2016 https://en.wikipedia.org/wiki/Category:Graph_algorithms Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 5, 2016 Share Posted May 5, 2016 (edited) if you're ignoring obstacles, you could just do something like this Position source = myPosition(); Position dest = new Position(x, y, z); List<Position> path = new ArrayList<>(); Position tmp = source; while (!tmp.equals(dest)) { int xOff = Integer.compare(dest.getX(), tmp.getX()); int yOff = Integer.compare(dest.getY(), tmp.getY()); tmp = tmp.translate(xOff, yOff); path.add(tmp); } Written in hand, so watch for errors. Not sure why you want to use a region in the form of a list of positions Edited May 5, 2016 by FrostBug Quote Link to comment Share on other sites More sharing options...