Advertisement
donovanwest

cocoaFarm

Jun 26th, 2022 (edited)
814
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function checkFuel()
  2.     if turtle.getFuelLevel() < 500 then
  3.         turtle.turnLeft()
  4.         turtle.turnLeft()
  5.         turtle.suck()
  6.         turtle.turnLeft()
  7.         turtle.turnLeft()
  8.         for slot = 1, 16, 1 do
  9.             turtle.select(slot)
  10.             turtle.refuel()
  11.         end
  12.     end
  13. end
  14.  
  15. function dump()
  16.     for slot = 4, 16, 1 do
  17.         turtle.select(slot)
  18.         turtle.dropDown()
  19.     end
  20. end
  21.  
  22. function getItemById(id)
  23.     for slot = 1, 16, 1 do
  24.         item = turtle.getItemDetail(slot)
  25.         if item ~= nil and item.name == id then
  26.             return slot
  27.         end
  28.     end
  29.     return nil
  30. end
  31.  
  32. os.sleep(5)
  33. while(true) do
  34.     checkFuel()
  35.     while(turtle.inspect()) do
  36.         -- if(turtle.getItemCount() == 0) then
  37.         --     turtle.select(getItemById("minecraft:cocoa_beans"))
  38.         -- end
  39.         turtle.dig()
  40.         turtle.place()
  41.         turtle.up()
  42.     end
  43.     while(turtle.down()) do end
  44.     dump()
  45.     os.sleep(420)
  46. end
  47.  
  48.  
Advertisement
RAW Paste Data Copied
Advertisement