View difference between Paste ID: jAJWZf0K and SYyYLi4B
SHOW: | | - or go back to the newest paste.
1-
print("Inserire URL")
1+
os.loadAPI("ocs/apis/sensor")
2-
local url = read()
2+
prox = sensor.wrap("back")
3-
local sExample = http.get("http://172.16.20.218/luanet/"..url..".lua") --Get contents of page
3+
lato = "right"
4-
loadstring(sExample.readAll())
4+
ritardo = 0
5-
sExample.close() --Just in case
5+
6
api1 = "56c6dc06748fb005225a39e8f1b2c86b"
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
rs.setOutput(lato, false)
23
elseif giocatore == "davidetecnik" or giocatore == "CrackMaster04" or giocatore == "eternalcaos" 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