Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- prox = sensor.wrap("top")
- lato = "right"
- ritardo = 0
- api1 = "epco-capannone-autocrafting-me"
- emailMandata = 0
- function mandaEmail()
- if emailMandata == 0 then
- emailMandata = 1
- http.get("http://172.16.20.220/luanet/servlets/notifier.php?api="..api1.."&var1="..giocatore)
- print("Email mandata")
- end
- end
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- giocatore = string.match(textutils.serialize(prox.getTargets()), '%w+')
- if giocatore == nil then
- print("Nessun giocatore rilevato")
- rs.setOutput(lato, false)
- elseif giocatore == "CAVALIERE2122" or giocatore == "lego11" then
- print("Giocatore autorizzato rilevato: "..giocatore)
- rs.setOutput(lato, false)
- else
- print("Rilevato giocatore non autorizzato: "..giocatore)
- mandaEmail()
- rs.setOutput(lato, true)
- end
- if emailMandata == 1 then
- ritardo = ritardo + 1
- end
- if ritardo == 120 then
- ritardo = 0
- emailMandata = 0
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement