Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function store_egg()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(2)
- turtle.drop(1)
- turtle.turnLeft()
- turtle.turnLeft()
- end
- local function craft_eggs()
- turtle.select(2)
- turtle.suck(1)
- if turtle.getItemCount() == 0 then
- return
- end
- turtle.craft(1)
- --Crafted item is in slot 2
- store_egg()
- end
- local function is_facing_egg_chest()
- local success, data = turtle.inspect()
- if not success then
- -- Air in front of it
- return false
- end
- if data.name == "minecraft:chest" then
- return true
- end
- return false
- end
- local function orient()
- while not is_facing_egg_chest() do
- turtle.turnLeft()
- end
- end
- local function clean_inventory()
- turtle.select(2)
- if turtle.getItemCount() > 0 then
- turtle.turnRight()
- turtle.drop(1)
- turtle.turnLeft()
- end
- end
- local function main()
- orient()
- clean_inventory()
- while true do
- craft_eggs()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement