TheCryptek

[LUA][OC] Server - Client broadcast

Aug 14th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. --Client [Robot]
  2.  
  3. local component = require("component")
  4. local event = require("event")
  5. local m = component.modem
  6.  
  7. m.open(100)
  8.  
  9. event.listen("modem_message",function(event,who,from,port,dist,message)
  10. if message == "active"
  11. then os.execute("/home/creeper.lua")
  12. else
  13. end
  14. end)
  15.  
  16. --Server [Computer]
  17.  
  18. local component = require("component")
  19. local event = require("event")
  20. local m = component.modem --get primary modem component
  21.  
  22. m.open(100)
  23.  
  24. m.broadcast(100,"active")
Advertisement
Add Comment
Please, Sign In to add comment