Guest User

startup

a guest
May 10th, 2021
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. --INSERIRE QUI LA API-KEY
  2. emailMandata = 0
  3. ritardo = 120
  4.  
  5. while true do
  6. os.pullEvent("redstone")
  7.  
  8. if rs.getInput("left") == true then
  9.   msg = "Marie Curie - Uranio in esaurimento"
  10. elseif rs.getInput("right") == true then
  11.   msg = "Marie Curie - CRITICO - Uranio esaurito"
  12. else
  13.   msg = null
  14. end
  15.  
  16. msgf = string.gsub(msg, " ", "%%20")
  17.  
  18. if msg ~= null then
  19. if emailMandata == 0 then
  20. emailMandata = 1
  21. http.get("http://172.16.20.220/luanet/servlets/ergb_diag.php?msg="..msgf)
  22. print("Email mandata: " .. msg)
  23. end
  24. end
  25. sleep(1)
  26. if emailMandata == 1 then
  27. ritardo = ritardo + 1
  28. end
  29.  
  30. if ritardo == 120 then
  31. os.reboot()
  32. ritardo = 0
  33. emailMandata = 0
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment