init.lua 739 B

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