Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- --LATO SENSORE
- se = sensor.wrap("top")
- --LATO ATTIVAZIONE REDSTONE QUANDO SQUILLA L'ALLARME
- lato = "left"
- ritardo = 0
- --INSERIRE QUI LA API-KEY
- api1 = ""
- --GIOCATORI PER CUI L'ALLARME NON SI ATTIVA
- giocatore1 = "DROVOSEK_"
- giocatore2 = "dionesalvi"-- l'ho fatto per provare niente razzismo
- giocatore3 = "MrCorona"
- emailMandata = 0
- os.loadAPI("ocs/apis/sensor")
- while true do
- ta = se.getTargets()
- for k,v in pairs(ta) do
- if v["Name"] == "Player" and k ~= "lego11" and k ~= giocatore1 and k ~= giocatore2 and k ~= giocatore3 then
- print("Rilevato giocatore non autorizzato: "..k)
- rs.setOutput(lato, true)
- if emailMandata == 0 then
- emailMandata = 1
- http.get("http://172.16.20.220/luanet/servlets/notifier.php?api="..api1.."&var1="..k)
- print("Email mandata")
- end
- else
- rs.setOutput(lato, true)
- sleep(3)
- rs.setOutput(lato, false)
- end
- end
- sleep(1)
- if emailMandata == 1 then
- ritardo = ritardo + 1
- end
- if ritardo == 120 then
- ritardo = 0
- emailMandata = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement