SHOW:
|
|
- or go back to the newest paste.
1 | --INSERIRE QUI LA API-KEY | |
2 | emailMandata = 0 | |
3 | ritardo = 120 | |
4 | ||
5 | m = peripheral.wrap("top") | |
6 | - | os.pullEvent("redstone") |
6 | + | |
7 | while true do | |
8 | - | if rs.getInput("left") == true then |
8 | + | a, b, c, d = m.get(1) |
9 | - | msg = "Marie Curie - Uranio in esaurimento" |
9 | + | |
10 | - | elseif rs.getInput("right") == true then |
10 | + | if d["amount"] < 6000000 then |
11 | - | msg = "Marie Curie - CRITICO - Uranio esaurito" |
11 | + | msg = "Alessandro Volta - Gasolio in esaurimento" |
12 | - | elseif rs.getInput("top") == true then |
12 | + | |
13 | - | msg = "Marie Curie - CRITICO - Uno o piĆ¹ reattori in SCRAM" |
13 | + | |
14 | end | |
15 | ||
16 | if msg ~= null then | |
17 | msgf = string.gsub(msg, " ", "%%20") | |
18 | if emailMandata == 0 then | |
19 | emailMandata = 1 | |
20 | http.get("http://172.16.20.220/luanet/servlets/ergb_diag.php?msg="..msgf) | |
21 | print("Email mandata: " .. msg) | |
22 | end | |
23 | end | |
24 | sleep(1) | |
25 | if emailMandata == 1 then | |
26 | ritardo = ritardo + 1 | |
27 | end | |
28 | ||
29 | if ritardo == 120 then | |
30 | os.reboot() | |
31 | ritardo = 0 | |
32 | emailMandata = 0 | |
33 | end | |
34 | end |