Advertisement
Guest User

drone.bios

a guest
Oct 21st, 2019
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local m=component.proxy(component.list("modem")(1)
  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