Advertisement
DabDaddy6223

bread_crafter_turtle

Jun 3rd, 2025 (edited)
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. function turnAround()
  2.     turtle.turnLeft()
  3.     turtle.turnLeft()
  4. end
  5.  
  6. function attemptCraft()
  7.     turtle.suck(3)
  8.  
  9.     local item = turtle.getItemDetail()
  10.     if item ~= nil then
  11.         if item["name"] == "minecraft:wheat" and item["count"] == 3 then
  12.             turtle.select(1)
  13.             turtle.transferTo(2, 1)
  14.             turtle.transferTo(3, 1)
  15.             turtle.craft()
  16.             return true, nil
  17.         end
  18.     end
  19.  
  20.     return false, item
  21. end
  22.  
  23. function main()
  24.     local cooldown = 0
  25.  
  26.     while true do
  27.         if cooldown <= 0 then
  28.             local success, item = attemptCraft()
  29.  
  30.             if success == true then
  31.                 turtle.select(1)
  32.                 turtle.dropDown()
  33.             else
  34.                 if item ~= nil then
  35.                     turtle.drop(item["count"])
  36.                 end
  37.                 cooldown = 250000
  38.             end
  39.         else
  40.             cooldown = cooldown - 1
  41.         end
  42.     end
  43. end
  44.  
  45. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement