Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this program should be used with Pipes piping into turtle.(Tested with Ender IO Item Conduits.)
- local count = 12 -- amount to drop
- local sapling = 15 --Uses this to determine sleep time for slot 15 item.
- local sapSleepTime = 3 -- time to wait before dropping saplings again
- local coal = 16 -- coal or charcoal. uses this to determine sleep time for slot 16 item.
- local coSleepTime = 41 -- time to wait before dropping coal again
- local empSleepTime = 30 -- time to wait for more items to arrive.
- function dropCoal()
- while turtle.getItemCount(1) < count do
- print("Sleeping for "..empSleepTime.." seconds.")
- sleep(empSleepTime)
- end
- if turtle.getItemCount(1) >= count then
- turtle.dropUp(count)
- print("Sleeping for "..coSleepTime.." seconds.")
- sleep(coSleepTime)
- end
- end
- function dropSapling()
- while turtle.getItemCount(1) < count do
- print("Sleeping for "..empSleepTime.." seconds.")
- sleep(empSleepTime)
- end
- if turtle.getItemCount(1) >= count then
- turtle.dropUp(count)
- print("Sleeping for "..sapSleepTime.." seconds.")
- sleep(sapSleepTime)
- end
- end
- function checkItem()
- if turtle.compareTo(coal) then
- dropCoal()
- elseif turtle.compareTo(sapling) then
- dropSapling()
- elseif not turtle.compareTo(sapling) then
- print("Please put a sapling in slot 15.")
- sleep(10)
- elseif not turtle.compareTo(coal) then
- print("Please put a piece of coal in slot 16.")
- sleep(10)
- end
- end
- while true do
- checkItem()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement