Advertisement
lego11

SKALA Beloyarsk

May 10th, 2021
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 = "Beloyarsk - Celle da arricchire quasi esaurite"
  10. elseif rs.getInput("right") == true then
  11.   msg = "Beloyarsk - CRITICO - Uno o più reattori in SCRAM"
  12. elseif rs.getInput("top") == true then
  13.   msg = "Beloyarsk - Uranio quasi esaurito"
  14. elseif rs.getInput("bottom") == true then
  15.   msg = "Beloyarsk - Polvere di carbone quasi esaurita"
  16. else
  17.   msg = null
  18. end
  19.  
  20. if msg ~= null then
  21. msgf = string.gsub(msg, " ", "%%20")
  22. if emailMandata == 0 then
  23. emailMandata = 1
  24. http.get("http://172.16.20.220/luanet/servlets/ergb_diag.php?msg="..msgf)
  25. print("Email mandata: " .. msg)
  26. end
  27. end
  28. sleep(1)
  29. if emailMandata == 1 then
  30. ritardo = ritardo + 1
  31. end
  32.  
  33. if ritardo == 120 then
  34. os.reboot()
  35. ritardo = 0
  36. emailMandata = 0
  37. end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement