jonassvensson4

Untitled

Jun 11th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- # Torches = 16 #
  2. -- # Empty   = 15 #
  3. print("Please place your turtle like this:")
  4. print(" # # # ")
  5. print(" # T # ")
  6. print("When ready, press start")
  7.  
  8. local message = io.read()
  9.  
  10. if ( message == "start" ) then
  11.         print("How many rows?")
  12.         message = io.read()
  13.  
  14.         rows = tonumber( message )
  15. end
  16.  
  17. if ( rows  ~= 0 ) then
  18.     -- # Branches #
  19.     for z=1, rows do
  20.         -- # Dig this branch #
  21.         for x=1, 40 do
  22.             turtle.dig()
  23.             turtle.forward()
  24.             turtle.digUp()
  25.         end
  26.  
  27.         -- # Full inventory #
  28.         if turtle.getItemCount( 15 ) > 0 then
  29.             shell.run("shutdown")
  30.         end
  31.                
  32.         -- # Return, placing torches #
  33.         turtle.select(16)
  34.  
  35.         for x=1, 40 do
  36.             turtle.back()
  37.  
  38.             if i % 6 == 0 then
  39.                 turtle.place()
  40.             end
  41.         end
  42.  
  43.         -- # Starting a new row #
  44.         turtle.turnLeft()
  45.         turtle.dig()
  46.         turtle.forward()
  47.         turtle.digUp()
  48.         turtle.dig()
  49.         turtle.forward()
  50.         turtle.digUp()
  51.         turtle.dig()
  52.         turtle.forward()
  53.         turtle.turnRight()
  54.     end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment