madbrad21

Filler

Mar 26th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. function needsFuel()
  2.   if turtle.getFuelLevel() < 10 then
  3.     return true
  4.   else
  5.     return false
  6.   end
  7. end
  8.  
  9. function refuel()
  10.   turtle.select(16)
  11.   turtle.refuel(1)
  12. end
  13.  
  14. function invCheck()
  15.   for slot = 1, 15 do
  16.     if turtle.getItemCount(slot) == 0 then
  17.       slot = slot + 1
  18.       turtle.select(slot)
  19.      end
  20.   end
  21.   if turtle.getItemCount(15) == 1 then
  22.     print("Feed Me!")
  23.     os.pullEvent(key)
  24.     turtle.placeDown()
  25.   end
  26. end
  27.  
  28. function blockDown()
  29.   while turtle.detectDown() == true do
  30.     print("Finding Hole")
  31.     turtle.turnRight()
  32.     turtle.forward()
  33.     turtle.turnRight()
  34.     turtle.forward()
  35.     turtle.turnLeft()
  36.   end
  37. end
  38.  
  39. function noblockDown()
  40.   if turtle.detectDown() == false then
  41.     turtle.select(1)
  42.     invCheck()
  43.     print("Placing Block")
  44.     turtle.placeDown()
  45.     turtle.forward()
  46.   else blockDown()
  47.   end
  48. end
  49.  
  50. function fill()
  51.   if needsFuel() then
  52.     refuel()
  53.   else noblockDown()
  54.  end
  55. end
  56.     while true do
  57.       fill()
  58.     end
Advertisement
Add Comment
Please, Sign In to add comment