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