Advertisement
Guest User

client.lua test opencomputers drone

a guest
Apr 18th, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local m=component.proxy(component.list("modem"))
  2. m.open(2412)
  3. local function respond(...)
  4. local args=table.pack(...)
  5. pcall(function() m.broadcast(2412, table.unpack(args)) end)
  6. end
  7. local function receive()
  8. while true do
  9. local evt,_,_,_,_,cmd=computer.pullSignal()
  10. if evt=="modem_message" then return load(cmd) end
  11. end
  12. end
  13. while true do
  14. local result,reason=pcall(function()
  15. local result,reason=receive()
  16. if not result then return respond(reason) end
  17. respond(result())
  18. end)
  19. if not result then respond(reason) end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement