1
Fork 0
This repository has been archived on 2025-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
computer-craft/bring
2012-06-03 11:58:03 +02:00

25 lines
538 B
Text

local args = { ... }
-- the wifi side, i guess...
rednet.open("right");
-- aks for the item
rednet.broadcast(args[1])
-- get ack
local id, message = rednet.receive(3)
if message == "ack" then
print("He is coming, please wait")
local id2 = nil
-- ignore other messages from others sources...
while (id ~= id2) or (message ~= "return") do
id2, message = rednet.receive()
end
print("He returned safely :)")
elseif message == "empty" then
printf("There is no " .. args[1])
else
print("No slave responded for " .. args[1])
end