SHOW:
|
|
- or go back to the newest paste.
| 1 | os.loadAPI("ocs/apis/sensor")
| |
| 2 | prox = sensor.wrap("back")
| |
| 3 | lato = "right" | |
| 4 | ritardo = 0 | |
| 5 | ||
| 6 | - | api1 = "56c6dc06748fb005225a39e8f1b2c86b" |
| 6 | + | api1 = "148d6933a3bb46985080ad58c66790e4" |
| 7 | - | api2 = "778935638247eddf41c6ad63c77dff4e" |
| 7 | + | |
| 8 | function mandaEmail() | |
| 9 | if emailMandata == 0 then | |
| 10 | emailMandata = 1 | |
| 11 | http.get("http://172.16.20.220/luanet/servlets/notifier.php?api="..api1.."&var1="..giocatore)
| |
| 12 | print("Email mandata")
| |
| 13 | end | |
| 14 | - | http.get("http://172.16.20.220/luanet/servlets/notifier.php?api="..api2.."&var1="..giocatore)
|
| 14 | + | |
| 15 | while true do | |
| 16 | term.clear() | |
| 17 | term.setCursorPos(1, 1) | |
| 18 | giocatore = string.match(textutils.serialize(prox.getTargets()), '%w+') | |
| 19 | if giocatore == nil then | |
| 20 | print("Nessun giocatore rilevato")
| |
| 21 | rs.setOutput(lato, false) | |
| 22 | elseif giocatore == "lego11" or giocatore == "CrackMaster04" then | |
| 23 | print("Giocatore autorizzato rilevato: "..giocatore)
| |
| 24 | rs.setOutput(lato, false) | |
| 25 | - | elseif giocatore == "Ale041" or giocatore == "SaniiM" or giocatore == "lego11" then |
| 25 | + | |
| 26 | print("Rilevato giocatore non autorizzato: "..giocatore)
| |
| 27 | mandaEmail() | |
| 28 | rs.setOutput(lato, true) | |
| 29 | end | |
| 30 | ||
| 31 | if emailMandata == 1 then | |
| 32 | ritardo = ritardo + 1 | |
| 33 | end | |
| 34 | ||
| 35 | if ritardo == 120 then | |
| 36 | ritardo = 0 | |
| 37 | emailMandata = 0 | |
| 38 | end | |
| 39 | ||
| 40 | sleep(1) | |
| 41 | end |