Advertisement
guamie

lights roof

Feb 28th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.98 KB | None | 0 0
  1. --lights roof
  2. --pastebin get rCRgnPKk blarg
  3.  
  4. --change updig to wait and check for gravel same for ForwardDig
  5.  
  6. --Turn turtle 180 Degrees
  7. function turnAround()
  8.     turtle.turnRight()
  9.     turtle.turnRight()
  10. end
  11.  
  12. --Tunneler
  13. function tunnel()
  14.     goForward()
  15.     turtle.digUp()
  16.     turtle.placeUp()
  17.     turtle.digDown()
  18. end
  19.  
  20. --Reset Position Right (Places Floor)
  21. function rpRight()
  22.     turtle.turnRight()
  23.     pFloor()
  24.     turtle.turnRight()
  25. end
  26.  
  27. --Reset Position Left (Places Floor)
  28. function rpLeft()
  29.     turtle.turnLeft()
  30.     pFloor()
  31.     turtle.turnLeft()
  32. end
  33.  
  34. -- Ensure turtle goes up
  35. function goUp()
  36.     while not turtle.up() do
  37.         upDig()
  38.     end
  39. end
  40.  
  41. --Ensure turtle goes down
  42. function goDown()
  43.     while not turtle.down() do
  44.         downDig()
  45.     end
  46. end
  47.  
  48. --place floor
  49.  
  50. function pFloor()
  51.  
  52. if turtle.detectDown() then
  53.     goForward()
  54. else
  55.     turtle.placeDown()
  56.     goForward()
  57.     end
  58. end
  59.  
  60. -- Ensure turtle moves forward
  61. function goForward()
  62.     while not turtle.forward() do
  63.         forwardDig()
  64.     end
  65. end
  66.  
  67. -- Dig forward
  68. function forwardDig()
  69.     while turtle.detect() do
  70.         turtle.dig()
  71.     end
  72. end
  73.  
  74. -- Dig up
  75. function upDig()
  76.     while turtle.detectUp() do
  77.         turtle.digUp()
  78.         sleep(.5)
  79.     end
  80.    
  81. end
  82.  
  83. -- Dig Down
  84. function downDig()
  85.     while turtle.detectDown() do
  86.         turtle.digDown()
  87.     end
  88. end
  89.  
  90. --Use Next Inventory Slot
  91. function useNinv()
  92. if turtle.getItemCount(p) == 0
  93.         then turtle.select(p)
  94.         p = p + 1
  95.         end
  96. end
  97.  
  98. --Make Wall 3 high, needs a space at end
  99. function Wall()
  100.     turtle.placeDown()
  101.     turtle.placeUp()
  102.     turtle.back()
  103.     turtle.place()
  104. end
  105.  
  106. --Clearing Above,Below, and moving Forward
  107. function clearForward()
  108.     upDig()
  109.     downDig()
  110.     goForward()
  111. end
  112.  
  113. --Clearing; Reseting Right
  114. function clearResetR()
  115.     upDig()
  116.     downDig()
  117.     turtle.turnRight()
  118.     goForward()
  119.     turtle.turtle.turnRight()
  120. end
  121.  
  122. --Clearing; Reseting Left
  123. function clearResetL()
  124.     upDig()
  125.     downDig()
  126.     turtle.turnLeft()
  127.     goForward()
  128.     turtle.turnLeft()
  129. end
  130.  
  131. --Clearing a 1x6x9 Area
  132. function RoomClearSection()
  133.     for o=1,8 do
  134.         clearForward()
  135.     end
  136. goUp()
  137. goUp()
  138. goUp()
  139. turnAround()
  140.     for o=1,8 do
  141.         clearForward()
  142.     end
  143. goDown()
  144. goDown()
  145. goDown()
  146.  
  147. end
  148.  
  149. function startMiner()
  150.     while not turtle.detect() do
  151.         if turtle.place() then
  152.             turtle.turnLeft()
  153.             goForward()
  154.             turtle.turnRight()
  155.             shell.run("format disk/")
  156.             fs.copy("routines/FillerUp","disk/FillerUp")
  157.             fs.copy("paths/"..count, "disk/startup")
  158.             fs.copy("returns/"..count,"disk/return")
  159.             fs.copy("routines/NetOnWait", "disk/NetOnWait")
  160.             fs.copy("routines/NetOnStart","disk/NetOnStart")
  161.             turtle.turnRight()
  162.             goForward()
  163.             turtle.turnLeft()
  164.             peripheral.call("front","turnOn")
  165.             count = count + 1
  166.     else
  167.         sleep(.1)
  168.        
  169.     end
  170.     end
  171.    
  172. end
  173.  
  174. function checkInv()
  175.  
  176. if turtle.getItemCount(c) == 0 then
  177.     c = c + 1
  178.     turtle.select(c)
  179. end
  180.  
  181. end
  182.  
  183. c = 1
  184.  
  185.  
  186. function pLights()
  187. turtle.digUp()
  188. turtle.placeUp()
  189. checkInv()
  190. goForward()
  191. goForward()
  192. goForward()
  193. goForward()
  194. end
  195.  
  196. for i=1, 11 do
  197.     pLights()
  198. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement