jonassvensson4

Untitled

Jun 8th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- #########################
  2. -- # Torches, Chest, Empty #
  3. -- #########################
  4. -- # Torches = 15          #
  5. -- # Chest   = 14          #
  6. -- #########################
  7.  
  8. print("Starting branch-program")
  9. print("Please place your turtle like this:")
  10. print(" # # # ")
  11. print(" # # # ")
  12. print(" # T # ")
  13. print("When ready, press start")
  14.  
  15. local message = io.read()
  16.  
  17. if ( message == "start" ) then
  18.     print("How many rows?")
  19.     message = io.read()
  20.  
  21.     rows = tonumber( message )
  22. end
  23.  
  24.     if ( rows  ~= 0 ) then
  25.         for i=1, rows do
  26.  
  27.                 turtle.dig()
  28.                 turtle.forward()
  29.                 turtle.digUp()
  30.         end
  31.  
  32. -- ##################
  33. -- # Full inventory #
  34. -- ##################
  35.      turtle.select(16)
  36.     turtle.getItemCount()
  37.             if turtle.getItemCount > 0 then
  38.                      turtle.select(14)
  39.                             turtle.place()
  40.                                       turtle.select(1)
  41.                                       turtle.drop()
  42.                                       turtle.select(2)
  43.                                       turtle.drop()
  44.                                       turtle.select(3)
  45.                                       turtle.drop()
  46.                                       turtle.select(4)
  47.                                       turtle.drop()
  48.                                       turtle.select(5)
  49.                                       turtle.drop()
  50.                                       turtle.select(6)
  51.                                       turtle.drop()
  52.                         turtle.select(14)
  53.                                 turtle.dig()
  54.                         end
  55.         else
  56.             turtle.select(15)
  57.         end
  58. -- ###########################
  59. -- # Return, placing torches #
  60. -- ###########################
  61.         turtle.select(15)
  62.  
  63.                 for i=1, rows do
  64.                         turtle.back()
  65.  
  66.                         if i % 6 == 0 then
  67.                                 turtle.place()
  68.                 end
  69.  
  70. -- ######################
  71. -- # Starting a new row #
  72. -- ######################
  73.         turtle.turnLeft()
  74.                 turtle.forward()
  75.         turtle.digUp()
  76.         turtle.digDown()
  77.                 turtle.forward()
  78.         turtle.digUp()
  79.         turtle.digDown()
  80.                 turtle.forward()
  81.         turtle.digUp()
  82.         turtle.digDown()
  83.                 turtle.turnRight()
  84. end
Advertisement
Add Comment
Please, Sign In to add comment