Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.select(1)
- bigSleep = false
- count = 0
- function check_inventory()
- local all_empty = false
- local data = turtle.getItemDetail(turtle.getSelectedSlot())
- while (turtle.getItemCount(turtle.getSelectedSlot())) <= 0 or (data.name == "minecraft:magma_block") do
- print('Moving slot')
- if turtle.getSelectedSlot() >= 16 then
- turtle.select(1)
- if all_empty then
- print('All inventory slots empty, shutting down')
- exit()
- end
- all_empty = true
- end
- turtle.select(turtle.getSelectedSlot()+1)
- data = turtle.getItemDetail(turtle.getSelectedSlot())
- end
- end
- while true do
- while turtle.detect() do
- sleep(0.5)
- bigSleep = true
- end
- if turtle.detectDown() then
- turtle.back()
- end
- if bigSleep then
- sleep(7.0)
- bigSleep = false
- end
- if count > 15 then
- turtle.select(16)
- else
- turtle.select(1)
- end
- check_inventory()
- if count > 18 then
- count = 0
- end
- count = count + 1
- turtle.placeDown()
- turtle.forward()
- end
Add Comment
Please, Sign In to add comment