Guest User

MoHelp

a guest
Jan 22nd, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. --[[   Go   ]]--
  2. function checkBlocks()
  3.     if turtle.detectUp() then
  4.         turtle.digUP()
  5.     end
  6.    
  7.     if turtle.dectectDown() then
  8.         return true
  9.     end
  10.    
  11.     elseif not turtle.detectDown() then
  12.         turtle.select(1)
  13.         sleep(0.375)
  14.         turtle.placeDown()
  15.     end
  16. end
  17.  
  18. function moveForward()
  19.     checkBlocks()
  20.     turtle.forward()
  21.     sleep(0.375)
  22.         if not turtle.forward() then
  23.             turtle.dig()
  24.             turtle.forward()
  25.         end
  26. end
  27.  
  28.  
  29. function tunnel()
  30.  
  31.       input = read()
  32.       print("tunneling "..input.." blocks deep...")
  33.        
  34.     for moved = 1, tonumber(input) do
  35.         moveForward()
  36.     end
  37.     moved = 0
  38.     print("Finished!!")
  39.     sleep(3)
  40.  
  41. end
  42.  
  43. print("How many spaces? ")
  44. tunnel()
  45. -- i know i suck at this...
Advertisement
Add Comment
Please, Sign In to add comment