Advertisement
hlprimm

Incremental Rail Placer

Jul 1st, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. $${
  2. //this script lays powered rails every so many rails. adjust the script below to fit your needs.
  3. //as of 1.8, supercarting requires 11 between powered rails. by placing every 11 blocks,
  4. //this script leaves 10 blocks of space to be safe.
  5. //recommended you assign this to a key and NOT to the button panel as a small mouse jitter will make it go off path.
  6.  
  7. //usage: face the direction you'll be placing rails. make sure powered rails are in your hotbar.
  8.  
  9. if(layrail);
  10. log("&2[Macro] &fRail laying Stopped.");
  11. keyup(forward);
  12. unset(layrail);
  13. stop();
  14. else;
  15. log("&2[Macro] &fRail laying Started.");
  16. set(layrail);
  17. pick(golden_rail);
  18.  
  19. //snap to cardinal direction and look down
  20. //thx to Sanwi, ShadowSniper, and Peter http://pastebin.com/V279kYXC
  21.  
  22. IF((%YAW% < 45) || (%YAW% >= 315));
  23. LOOK(180,90);
  24. ELSEIF((%YAW% < 314) && (%YAW% >= 225));
  25. LOOK(90,90);
  26. ELSEIF((%YAW% < 224) && (%YAW% >= 135));
  27. LOOK(0,90);
  28. ELSEIF((%YAW% < 134) && (%YAW% >= 45));
  29. LOOK(270,90);
  30. ENDIF;
  31.  
  32. //change 11 to whatever distance you want to place the rail on.
  33. //whatever number you put, 1 less than that number will be the amount blocks where no rail is laid.
  34. //in this example, A is a rail placed, and B is the next rail placed. A ---10 blocks--- B
  35.  
  36. do;
  37. #xplusten = %XPOS% + 11;
  38. #zplusten = %ZPOS% + 11;
  39. #xminusten = %XPOS% - 11;
  40. #zminusten = %ZPOS% - 11;
  41.  
  42. do;
  43. keydown(forward);
  44. until((%ZPOS% = %#zplusten%) || (%XPOS% = %#xplusten%) || (%ZPOS% = %#zminusten%) || (%XPOS% = %#xminusten%));
  45. keyup(forward);
  46. key(use);
  47. keydown(forward);
  48. pick(golden_rail);
  49. if( %ITEM% != "golden_rail");
  50. log("There are no more rails left to use. Stopping now.");
  51. keyup(forward);
  52. unset(layrail);
  53. break();
  54. endif;
  55. loop;
  56.  
  57. endif;
  58.  
  59. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement