jBlume

floor 2 (testing)

Apr 21st, 2015 (edited)
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 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. --Place first block
  17. turtle.forward()
  18. turtle.turnRight()
  19. turtle.turnRight()
  20. turtle.place()
  21.  
  22. --Main Program
  23. while true do
  24.  turtle.back()
  25.  turtle.place()
  26.  
  27. --Item Count Start Variable
  28. r=1
  29. --Item Detection/Change Item Slots
  30.  if r<16 and turtle.getItemCount(r)<1 then
  31.   r=r+1
  32.   turtle.select(r)
  33.  end
  34.  if r==16 and turtle.getItemCount(r)<1 then
  35.   print "Out of Items"
  36.   turtle.reboot()
  37.  end
  38. --Turn Right Detection/Floor Finished Detection
  39.  if turtle.back()== false then
  40.   turtle.turnRight()
  41.   if turtle.back()== false then
  42.    turtle.turnRight()
  43.    if turtle.back()== false then
  44.     turtle.turnRight()
  45.     if turtle.back()== false then
  46.      turtle.turnRight()
  47.      if turtle.back()== false then
  48.       turtle.turnRight()
  49.       if turtle.back()== false 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