Advertisement
Guest User

carveRoom

a guest
Mar 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local z=1
  2. local x=1
  3. local y=1
  4. local times =0
  5. local times2 =0
  6. local times3 =0
  7. function forward()
  8.   if not turtle.forward() then do
  9.     turtle.dig()
  10.   end
  11.  end
  12. end
  13.  
  14. function tunnel()
  15.   turtle.dig()
  16.   forward()
  17.   turtle.digUp()
  18.   turtle.digDown()
  19. end
  20.  
  21. print("How Long?")
  22.   times = read()
  23.  
  24. print("How Wide?")
  25.   times2 = read()
  26.  
  27. print("How Tall?")
  28.   times3 = read()
  29.  
  30. function Row()
  31.  
  32.  if z==1 then  
  33.  
  34.   for z = 1, times do
  35.     tunnel()
  36.   end
  37.  
  38.   for z = 2, times do
  39.     turtle.back()
  40.   end  
  41. z = z+1
  42. else do
  43.   for z = 2, times do
  44.     tunnel()
  45.   end    
  46.  
  47.   for z =2, times do
  48.     turtle.back()
  49.    end  
  50.   end
  51.  end
  52. end
  53.  
  54. function Left()
  55.     turtle.turnLeft()
  56.     turtle.dig()
  57.     tunnel()
  58.     turtle.turnRight()
  59.    x = x+1
  60. end      
  61.  
  62. if x==<times2 then do
  63.     Row()
  64.     Left()
  65. end
  66. else do
  67.   row()
  68. end
  69. end
  70.  
  71. turtle.turnRight()
  72.  
  73. x =1
  74.  
  75. for x =1,times2 do
  76.   turtle.forward()
  77. end
  78.  
  79. turtle.turnLeft()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement