Advertisement
kolton

Untitled

Dec 20th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. openDoors: function (x, y) {
  2. // Regular doors
  3. var i, tick,
  4. door = getUnit(2, getLocaleString(3282), 0); // "Door"
  5.  
  6. if (door) {
  7. do {
  8. if (getDistance(door, x, y) < 4 || getDistance(me, door) < 4) { // TODO: Adjust to optimal distances
  9. for (i = 0; i < 3; i += 1) {
  10. door.interact();
  11.  
  12. tick = getTickCount();
  13.  
  14. while (getTickCount() - tick < 1000) {
  15. if (door.mode === 2) {
  16. me.overhead("Opened a door!");
  17.  
  18. return true;
  19. }
  20.  
  21. delay(10);
  22. }
  23. }
  24. }
  25. } while (door.getNext());
  26. }
  27.  
  28. // TODO: Monsta doors (Barricaded)
  29.  
  30. return false;
  31. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement