FrozenSpring

temple mover

Nov 12th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. -- 21x21 base, 15 high
  2.  
  3.  
  4. local height = 1 -- 15
  5. local width = 21
  6. local depth = 21
  7. local heightToMove = 11
  8. local turningRight = false
  9.  
  10. local function forward()
  11.  if turtle.detect() then
  12.   turtle.dig()
  13.   turtle.forward()
  14.   shell.run("go", "up", heightToMove)
  15.   turtle.placeUp()
  16.   shell.run("go", "down", heightToMove)
  17.  else
  18.   turtle.forward()
  19.  end
  20. end
  21.  
  22. local function turnRight()
  23.  turtle.turnRight()
  24.  forward()
  25.  turtle.turnRight()
  26. end
  27.  
  28. local function turnLeft()
  29.  turtle.turnLeft()
  30.  forward()
  31.  turtle.turnLeft()
  32. end
  33.  
  34. local function turn()
  35.  if turningRight == true then
  36.   turnRight()
  37.   turningRight = false
  38.  else
  39.   turnLeft()
  40.   turningRight = true
  41.  end
  42. end
  43.  
  44. for z = 1, height do
  45.  for x = 1, width do
  46.   for y = 1, depth do
  47.    forward()
  48.   end
  49.   turn()
  50.  end
  51. turtle.digDown()
  52. turtle.down()
  53. turtle.placeUp()
  54. turningRight = not turningRight
  55. end
Add Comment
Please, Sign In to add comment