init.lua 707 B

123456789101112131415161718192021222324252627282930313233
  1. --[[ ASSUMPTIONS
  2. yorecipient.txt exists
  3. ]]
  4. DEBUG = true
  5. SETUP = false
  6. SETUP_TIMEOUT = 120000
  7. STARTUP_DELAY_TIMER = 0
  8. INTERRUPT_TIMER = 1
  9. INDEX_TIMER = 2
  10. SETUP_INACTIVITY_TIMER = 3
  11. WIFI_WAIT_TIMER = 4
  12. SUCCESS_SETUP_TIMER = 5
  13. YO_RECIPIENT = nil
  14. print("3 second startup delay using timer " .. STARTUP_DELAY_TIMER .. '...')
  15. tmr.alarm(STARTUP_DELAY_TIMER, 3000, 0, function ()
  16. print("Starting.")
  17. function debugMsg(msg)
  18. print("Yo debug: " .. msg)
  19. end
  20. -- yo recipient file must exist
  21. yoRecipientExists = file.open('yorecipient.txt', 'r')
  22. YO_RECIPIENT = file.read()
  23. file.close()
  24. debugMsg('found recipient: ' .. tostring(YO_RECIPIENT))
  25. dofile("interrupt.lua")
  26. end)