trainworld_computercraft/computer/4/bake.lua
2025-05-22 20:51:25 +02:00

34 lines
767 B
Lua

chest = peripheral.wrap("front")
local function bake()
for i = 2,16 do
turtle.select(i)
turtle.drop()
end
turtle.suck()
items = chest.list()
local pretty = require "cc.pretty"
pretty.pretty_print(items)
for k,v in pairs(items) do
if v.name == "minecraft:wheat" then
chest.pushItems("front",k,64,1)
end
end
turtle.drop()
turtle.select(2)
count = chest.getItemDetail(1).count/3
turtle.suck(count)
turtle.select(5)
turtle.suck(count)
turtle.select(6)
turtle.suck(count)
for i = 1, count do
turtle.select(1)
turtle.placeDown()
turtle.craft()
turtle.select(3)
turtle.drop()
end
end
bake()