G2A Many GEOs
SHARE
TWEET

beacon[transmitter] API

kssr3951 May 6th, 2017 (edited) 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- =========================================================
  2. -- beacon[transmitter] API
  3. -- =========================================================
  4. -- ----------------------------------------------------
  5. -- Config
  6. -- ----------------------------------------------------
  7. local PROTOCOL_NAME = "BEACON"
  8. local TRANSMITTER_SEND_INTERVAL = 1
  9. local TRANSMITTER_MODEM_DIRECTION = "right"
  10. -- ----------------------------------------------------
  11. -- transmitter
  12. -- ----------------------------------------------------
  13. -- -- example
  14. -- local main = function()
  15. --   for i = 1, 100 do turtle.up() turtle.down() end
  16. -- end
  17. -- os.loadAPI("beacon")
  18. -- beacon.TRANSMITTER_MODEM_DIRECTION = "left"
  19. -- parallel.waitForAll(main, beacon.transmitter)
  20. function transmitter()
  21.     rednet.open(TRANSMITTER_MODEM_DIRECTION)
  22.     while true do
  23.         rednet.broadcast(os.getComputerLabel(), PROTOCOL_NAME)
  24.         os.sleep(TRANSMITTER_SEND_INTERVAL)
  25.     end
  26.     rednet.close()
  27. end
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top