Advertisement
hlprimm

LeverPlacer

Jul 16th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. //auto place rail levers. WIP
  2.  
  3. $${
  4. //description
  5.  
  6. //usage
  7.  
  8. if(laylever);
  9. log("&2[Macro] &fLever laying Stopped.");
  10. keyup(forward);
  11. unset(laylever);
  12. stop();
  13. else;
  14. log("&2[Macro] &fLever laying Started.");
  15. set(laylever);
  16. pick(lever);
  17.  
  18. //snap to cardinal direction and look down
  19. //thx to Sanwi, ShadowSniper, and Peter http://pastebin.com/V279kYXC
  20.  
  21. IF((%YAW% < 45) || (%YAW% >= 315));
  22. LOOK(180,90);
  23. #yaw = 180;
  24. ELSEIF((%YAW% < 314) && (%YAW% >= 225));
  25. LOOK(90,90);
  26. #yaw = 90;
  27. ELSEIF((%YAW% < 224) && (%YAW% >= 135));
  28. LOOK(0,90);
  29. #yaw = 0;
  30. ELSEIF((%YAW% < 134) && (%YAW% >= 45));
  31. LOOK(270,90);
  32. #yaw = 270;
  33. ENDIF;
  34.  
  35. //change 11 to whatever distance you want to place the rail on.
  36. //whatever number you put, 1 less than that number will be the amount blocks where no rail is laid.
  37. //in this example, A is a rail placed, and B is the next rail placed. A ---10 blocks--- B
  38.  
  39. do;
  40. #xplusten = %XPOS% + 11;
  41. #zplusten = %ZPOS% + 11;
  42. #xminusten = %XPOS% - 11;
  43. #zminusten = %ZPOS% - 11;
  44.  
  45. do;
  46. keydown(forward);
  47. until((%ZPOS% = %#zplusten%) || (%XPOS% = %#xplusten%) || (%ZPOS% = %#zminusten%) || (%XPOS% = %#xminusten%));
  48. log("keyup forward");
  49. keyup(forward);
  50. LOOK(-90,70);
  51. pick(diamond_pickaxe);
  52. do(2000ms);
  53. key(attack);
  54. loop;
  55. loop;
  56.  
  57. endif;
  58.  
  59. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement