oxgon

WitherTurtle

Mar 14th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.55 KB | None | 0 0
  1. --  Oxgon's Wither Boss Spawner
  2.  
  3. --  First slot soul sand
  4. --  Second slot Wither Skulls
  5.  
  6. function up()
  7.         while(not turtle.up()) do sleep(1) end
  8. end
  9.  
  10. function left()
  11.         while(not turtle.turnLeft()) do sleep(1) end
  12. end
  13.  
  14. function right()
  15.         while(not turtle.turnRight()) do sleep(1) end
  16. end
  17.  
  18. function back()
  19.         while(not turtle.back()) do sleep(1) end
  20. end
  21.  
  22. function forward()
  23.         while(not turtle.forward()) do sleep(1) end
  24. end
  25.  
  26. function down()
  27.         while(not turtle.down()) do sleep(1) end
  28. end
  29.  
  30. function place()
  31.         while(not turtle.place()) do sleep(1) end
  32. end
  33.  
  34. function placeDown()
  35.         turtle.placeDown()
  36.         if(not turtle.detectDown()) then placeDown() end
  37. end
  38.  
  39. function getSoul()                                     -- turtles have no soul
  40.         turtle.select(16)
  41.         turtle.suckDown()
  42.         turtle.transferTo(1,4)
  43.         turtle.dropDown()
  44.        
  45. end
  46.  
  47. function getSkull()
  48.         turtle.select(16)
  49.         left()
  50.         turtle.suck()
  51.         turtle.transferTo(2,3)
  52.         turtle.drop()
  53.         right()
  54. end
  55.  
  56. function home()
  57.         back()
  58.         back()
  59.         back()
  60.         down()
  61.         down()
  62.         down()
  63.         down()
  64.         down()
  65.         forward()
  66.         forward()
  67.         forward()
  68.         forward()
  69.         forward()
  70.         right()
  71.         back()
  72. end
  73.    
  74.  
  75. -- Program Start
  76. while (true) do
  77. while(not rs.getInput("right")) do sleep(3) end
  78. getSoul()
  79. getSkull()
  80. up()
  81. up()
  82. up()
  83. turtle.select(1)
  84. place()
  85. up()
  86. place()
  87. left()
  88. forward()
  89. right()
  90. place()
  91. up()
  92. up()
  93. forward()
  94. right()
  95. turtle.select(2)
  96. placeDown()
  97. forward()
  98. placeDown()
  99. forward()
  100. down()
  101. turtle.select(1)
  102. placeDown()
  103. up()
  104. forward()
  105. left()
  106. left()
  107. down()
  108. turtle.select(2)
  109. place()
  110. home()
  111. end
Advertisement
Add Comment
Please, Sign In to add comment