Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --INSERIRE QUI LA API-KEY
- emailMandata = 0
- ritardo = 120
- while true do
- os.pullEvent("redstone")
- if rs.getInput("left") == true then
- msg = "Beloyarsk - Celle da arricchire quasi esaurite"
- elseif rs.getInput("right") == true then
- msg = "Beloyarsk - CRITICO - Uno o più reattori in SCRAM"
- elseif rs.getInput("top") == true then
- msg = "Beloyarsk - Uranio quasi esaurito"
- elseif rs.getInput("bottom") == true then
- msg = "Beloyarsk - Polvere di carbone quasi esaurita"
- else
- msg = null
- end
- if msg ~= null then
- msgf = string.gsub(msg, " ", "%%20")
- if emailMandata == 0 then
- emailMandata = 1
- http.get("http://172.16.20.220/luanet/servlets/ergb_diag.php?msg="..msgf)
- print("Email mandata: " .. msg)
- end
- end
- sleep(1)
- if emailMandata == 1 then
- ritardo = ritardo + 1
- end
- if ritardo == 120 then
- os.reboot()
- ritardo = 0
- emailMandata = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement