SHOW:
|
|
- or go back to the newest paste.
| 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 | elseif rs.getInput("top") == true then
| |
| 13 | msg = "Marie Curie - CRITICO - Uno o più reattori in SCRAM" | |
| 14 | else | |
| 15 | msg = null | |
| 16 | end | |
| 17 | ||
| 18 | if msg ~= null then | |
| 19 | msgf = string.gsub(msg, " ", "%%20") | |
| 20 | if emailMandata == 0 then | |
| 21 | emailMandata = 1 | |
| 22 | http.get("http://172.16.20.220/luanet/servlets/ergb_diag.php?msg="..msgf)
| |
| 23 | print("Email mandata: " .. msg)
| |
| 24 | end | |
| 25 | end | |
| 26 | sleep(1) | |
| 27 | if emailMandata == 1 then | |
| 28 | ritardo = ritardo + 1 | |
| 29 | end | |
| 30 | ||
| 31 | if ritardo == 120 then | |
| 32 | os.reboot() | |
| 33 | ritardo = 0 | |
| 34 | emailMandata = 0 | |
| 35 | end | |
| 36 | end |