Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- items = { }
- input= "back"
- output= "bottom"
- receiver = 3
- function clearscreen()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function suckItems()
- turtle.select(1)
- redstone.setOutput(output, false)
- redstone.setOutput(input, true)
- repeat
- sleep(1)
- until turtle.getItemCount(16) > 0
- redstone.setOutput(input, false)
- end
- function emptyInv()
- redstone.setOutput(output, true)
- repeat
- sleep(0.5)
- totalinv = 0
- for i=1, 16 do
- totalinv = totalinv + turtle.getItemCount(i)
- end
- until totalinv == 0
- end
- function countItems()
- for i=1, 16 do
- if turtle.getItemCount(i) > 0 then
- data = turtle.getItemDetail(i)
- msg = table.concat({data.name, data.count,data.damage}, " ")
- rednet.send(receiver, msg)
- --print(msg)
- end
- end
- end
- function doit()
- while true do
- suckItems()
- countItems()
- emptyInv()
- sleep(0.5)
- end
- end
- doit()
Add Comment
Please, Sign In to add comment