Advertisement
guamie

Blarg

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