Cynsye

Tower15

Jan 25th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. shell.run("clear")
  2. print("Note:")
  3. print("- For now, please ensure that this turtle has sufficient fuel already registered")
  4. print("- Please ensure that there is a suitable method of restocking this turtle via enderchest")
  5. sleep(3)
  6. shell.run("clear")
  7. print("How many blocks high do you wish the tower to be?")
  8. sleep(0.5)
  9. local height = tonumber(read())
  10. shell.run("clear")
  11. print("Construction in progress")
  12.  
  13. function RPlace()  -- Selecting random block, and placing it down in the world
  14. local q = 0
  15. repeat
  16. local r = math.random(1, 12)
  17.     if q == 15 then  -- Checking if the turtle needs to be restocked
  18.         local q = 0
  19.         print("Restocking")
  20.         turtle.select(16)  -- Enderchest
  21.         turtle.placeDown()
  22.     local s = 0
  23.         repeat
  24.         turtle.suckDown()
  25.     s = s + 1
  26.     until s == 12
  27.     turtle.digDown()
  28.     end
  29. q = q + 1
  30. turtle.select(r)
  31. until turtle.getItemCount(r) > 1
  32. turtle.placeDown()
  33. end
  34.  
  35. local k = 0  -- Level counter
  36. repeat
  37.  
  38. local j = 0  -- Circle Start
  39. repeat
  40.     local i = 0
  41.         repeat
  42.         RPlace()  --SB1-5
  43.         turtle.forward()
  44.     i = i + 1
  45.     until i == tonumber(5)
  46.  
  47.     turtle.turnRight()
  48.     turtle.forward()
  49.         RPlace()  -- CB1
  50.     turtle.turnLeft()
  51.     turtle.forward()
  52.         RPlace()  -- CB2
  53.     turtle.forward()
  54.     turtle.turnRight()
  55.     turtle.forward()
  56.         RPlace()  -- CB3
  57.     turtle.turnLeft()
  58.     turtle.forward()
  59.     turtle.turnRight()
  60.     turtle.forward()
  61.         RPlace()  -- CB4
  62.     turtle.forward()
  63.         RPlace()  -- CB5
  64.     turtle.turnLeft()
  65.     turtle.forward()
  66.     turtle.turnRight()
  67.     turtle.forward()
  68.  
  69. j = j + 1
  70. until j == 4
  71.  
  72. turtle.up()
  73. k = k + 1
  74. until k == height
  75.  
  76. print("Construction complete!")
Advertisement
Add Comment
Please, Sign In to add comment