Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- down - injector
- --]]
- local turtle_id = 13
- -----------------
- rednet.open("left")
- while true do
- local id, msg = rednet.receive()
- if id == turtle_id then
- local error = ""
- if msg == "RETRIEVE" then
- print("Processed command to retrieve item")
- turtle.suckDown()
- else
- for i=1,16 do
- local slot = turtle.getItemDetail(i)
- if slot and slot.name == msg.name and slot.damage == msg.damage then
- print("Processed command to send item: " .. msg.name .. "/" .. msg.damage)
- turtle.select(i)
- turtle.dropDown()
- break
- elseif i == 16 then
- print("Item not found: " .. msg.name .. "/" .. msg.damage)
- error = msg.name .. "/" .. msg.damage .. " not found"
- end
- end
- end
- if error ~= "" then
- rednet.send(id, error)
- else
- rednet.send(id, "DONE")
- end
- end
- end
Add Comment
Please, Sign In to add comment