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" |
9 | + | msg = "Beloyarsk - Celle da arricchire quasi esaurite" |
10 | elseif rs.getInput("right") == true then | |
11 | - | msg = "Marie Curie - CRITICO - Uranio esaurito" |
11 | + | msg = "Beloyarsk - CRITICO - Uno o più reattori in SCRAM" |
12 | elseif rs.getInput("top") == true then | |
13 | - | msg = "Marie Curie - CRITICO - Uno o più reattori in SCRAM" |
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 |