Advertisement
Guest User

bois

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