Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inv=peripheral.wrap("top")
- local function getcake()
- for i=1,inv.size() do
- slotmeta=inv.getItemMeta(i)
- if slotmeta~=nil and slotmeta.name=="minecraft:cake" then
- inv.pushItems("down",i,1,1)
- return
- end
- end
- end
- --test if there is cake below, if not then place
- while true do
- if turtle.getItemCount(1)<1 then
- getcake()
- end
- local success,blockdata=turtle.inspectDown()
- if blockdata.name ~=nil and string.find(blockdata.name, "minecraft:cake") then
- --print("cake found")
- sleep(1)
- else --place cake
- turtle.select(1)
- turtle.placeDown()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement