jBlume

Floor

Jun 27th, 2013 (edited)
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. --Select Itemslot 1
  2. turtle.select(1)
  3.  
  4. --Fuel Detection Safety
  5. if turtle.getFuelLevel()<100 then
  6.  print "I need Fuel"
  7.  turtle.reboot()
  8. end
  9.  
  10. --Item Detection Safety
  11. if turtle.getItemCount(1)<1 then
  12.  print "I need building material."
  13.  turtle.reboot()
  14. end
  15.  
  16. --Item Count Start Variable
  17. r=1
  18.  
  19. --Main Program
  20. while true do
  21.  turtle.forward()
  22.  turtle.turnRight()
  23.  turtle.turnRight()
  24.  turtle.place()
  25.  turtle.turnRight()
  26.  turtle.turnRight()
  27.  
  28. --Item Detection/Change Item Slots
  29.  if r<16 and turtle.getItemCount(r)<1 then
  30.   r=r+1
  31.   turtle.select(r)
  32.  end
  33.  if r==16 and turtle.getItemCount(r)<1 then
  34.   print "Out of Items"
  35.   turtle.reboot()
  36.  end
  37.  
  38. --Turn Right Detection/Floor Finished Detection
  39.  if turtle.detect() then
  40.   turtle.turnRight()
  41.   if turtle.detect() then
  42.    turtle.turnRight()
  43.    if turtle.detect() then
  44.     turtle.turnRight()
  45.     if turtle.detect() then
  46.      turtle.turnRight()
  47.      if turtle.detect() then
  48.       turtle.turnRight()
  49.       if turtle.detect() then
  50.        turtle.up()
  51.        turtle.placeDown()
  52.        print "The floor has been made."
  53.        turtle.reboot()
  54.        end
  55.      end
  56.     end
  57.    end
  58.   end
  59.  end
  60. end
Add Comment
Please, Sign In to add comment