09glich

MobileComs.lua

Jun 13th, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. local PortMobile = 0
  2.  
  3. local PingDB = 0
  4. local function PingOtherDevices()
  5.     if PingDB >= 20 then
  6.         rednet.send(1,"Hello")
  7.     end
  8.     PingDB = PingDB + 1
  9. end
  10.  
  11. local function GetPings()
  12.     local ID, message = rednet.receive(nil,.05)
  13.     if message then
  14.         print(ID.." : "..message)
  15.     end
  16. end
  17.  
  18. while true do
  19.     sleep(.05)
  20.     GetPings()
  21.     PingOtherDevices()
  22. end
Add Comment
Please, Sign In to add comment