Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- move: function (spot) {
- if (!me.inTown) { // To prevent long trips if tp to town failed
- throw new Error("Town.move: You're not in town!");
- }
- // TODO: Add character config variable for telekinesis
- while (!me.idle) {
- delay(40);
- }
- var townSpot,
- useTK = me.classid === 1 && me.getSkill(43, 1) && ["stash", "portalspot", "waypoint"].indexOf(spot) > -1;
- if (!this.act[me.act - 1].initialized) {
- this.initialize();
- }
- if (typeof (this.act[me.act - 1].spot[spot]) === "object") {
- print("Moving to " + spot + " from " + me.x + " " + me.y);
- townSpot = this.act[me.act - 1].spot[spot];
- } else {
- print("ΓΏc1Invalid town spot: " + spot);
- return false;
- }
- var temp = Pather.getNearestWalkable(townSpot[0], townSpot[1], 6, 1);
- if (useTK) {
- if (getDistance(me, townSpot[0], townSpot[1]) > 14) {
- Attack.getIntoPosition({x: temp[0], y: temp[1]}, 14, 0x4);
- }
- } else {
- Pather.moveTo(temp[0], temp[1], 3);
- }
- return true;
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement