Advertisement
MrDionesalvi

Untitled

Aug 20th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2.  
  3. --LATO SENSORE
  4. se = sensor.wrap("top")
  5.  
  6. --LATO ATTIVAZIONE REDSTONE QUANDO SQUILLA L'ALLARME
  7. lato = "left"
  8. ritardo = 0
  9.  
  10.  
  11. --INSERIRE QUI LA API-KEY
  12. api1 = ""
  13.  
  14. --GIOCATORI PER CUI L'ALLARME NON SI ATTIVA
  15. giocatore1 = "DROVOSEK_"
  16. giocatore2 = "dionesalvi"-- l'ho fatto per provare niente razzismo
  17. giocatore3 = "MrCorona"
  18.  
  19.  
  20. emailMandata = 0
  21. os.loadAPI("ocs/apis/sensor")
  22. while true do
  23. ta = se.getTargets()
  24. for k,v in pairs(ta) do
  25. if v["Name"] == "Player" and k ~= "lego11" and k ~= giocatore1 and k ~= giocatore2 and k ~= giocatore3 then
  26. print("Rilevato giocatore non autorizzato: "..k)
  27. rs.setOutput(lato, true)
  28. if emailMandata == 0 then
  29. emailMandata = 1
  30. http.get("http://172.16.20.220/luanet/servlets/notifier.php?api="..api1.."&var1="..k)
  31. print("Email mandata")
  32. end
  33. else
  34.     rs.setOutput(lato, true)
  35.  sleep(3)
  36.  rs.setOutput(lato, false)
  37. end
  38. end
  39. sleep(1)
  40. if emailMandata == 1 then
  41. ritardo = ritardo + 1
  42. end
  43.  
  44. if ritardo == 120 then
  45. ritardo = 0
  46. emailMandata = 0
  47. end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement