Advertisement
Guest User

Opencomputers Drone Wireless Connection EEPROM

a guest
May 2nd, 2020
3,263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local modem = component.proxy(component.list("modem")())
  2. local connected
  3.  
  4. modem.open(122)
  5.  
  6. computer.beep(500, .2)
  7. computer.beep(700, .2)
  8.  
  9. ::connect::
  10. local _, _, from, port, _, message = computer.pullSignal()
  11.  
  12. if (message == "dcaccepted") then
  13.   computer.beep(800, .2)
  14.   computer.beep(800, .2)
  15.   connected = from
  16. else
  17.   goto connect
  18. end
  19.  
  20. while true do
  21.   local _, _, from, port, _, message, arg1 = computer.pullSignal()
  22.  
  23.   if(message == "call") then
  24.     if arg1 then
  25.       local l, err  = load("return "..arg1)
  26.       if l then
  27.         local ok, f = pcall(l)
  28.         if ok then
  29.           f()
  30.         end
  31.       end
  32.     end
  33.   end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement