Advertisement
kolton

Untitled

May 7th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. move: function (spot) {
  2. if (!me.inTown) { // To prevent long trips if tp to town failed
  3. throw new Error("Town.move: You're not in town!");
  4. }
  5.  
  6. // TODO: Add character config variable for telekinesis
  7. while (!me.idle) {
  8. delay(40);
  9. }
  10.  
  11. var townSpot,
  12. useTK = me.classid === 1 && me.getSkill(43, 1) && ["stash", "portalspot", "waypoint"].indexOf(spot) > -1;
  13.  
  14. if (!this.act[me.act - 1].initialized) {
  15. this.initialize();
  16. }
  17.  
  18. if (typeof (this.act[me.act - 1].spot[spot]) === "object") {
  19. print("Moving to " + spot + " from " + me.x + " " + me.y);
  20. townSpot = this.act[me.act - 1].spot[spot];
  21. } else {
  22. print("ΓΏc1Invalid town spot: " + spot);
  23.  
  24. return false;
  25. }
  26.  
  27. var temp = Pather.getNearestWalkable(townSpot[0], townSpot[1], 6, 1);
  28.  
  29. if (useTK) {
  30. if (getDistance(me, townSpot[0], townSpot[1]) > 14) {
  31. Attack.getIntoPosition({x: temp[0], y: temp[1]}, 14, 0x4);
  32. }
  33. } else {
  34. Pather.moveTo(temp[0], temp[1], 3);
  35. }
  36.  
  37. return true;
  38. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement