Advertisement
lego11

Pirlatore Borealis

Apr 12th, 2021
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("ocs/apis/sensor")
  2.  
  3. --LATO SENSORE
  4. se = sensor.wrap("right")
  5.  
  6. --LATO ATTIVAZIONE REDSTONE QUANDO SQUILLA L'ALLARME
  7. lato = "left"
  8. ritardo = 0
  9.  
  10. --GIOCATORI PER CUI L'ALLARME NON SI ATTIVA
  11. giocatore1 = "Kiiw"
  12. giocatore2 = "Lay4play"
  13. giocatore3 = ""
  14.  
  15.  
  16. emailMandata = 0
  17. os.loadAPI("ocs/apis/sensor")
  18. while true do
  19. ta = se.getTargets()
  20. for k,v in pairs(ta) do
  21. if v["Name"] == "Player" and k ~= "lego11" and k ~= giocatore1 and k ~= giocatore2 and k ~= giocatore3 then
  22. print("Rilevato giocatore non autorizzato: "..k)
  23. rs.setOutput(lato, true)
  24. if emailMandata == 0 then
  25. emailMandata = 1
  26. http.get("http://172.16.20.220/luanet/servlets/pirlator.php?user="..k)
  27. print("Email mandata")
  28. end
  29. else
  30.     rs.setOutput(lato, false)
  31. end
  32. end
  33. sleep(1)
  34. if emailMandata == 1 then
  35. ritardo = ritardo + 1
  36. end
  37.  
  38. if ritardo == 600 then
  39. ritardo = 0
  40. emailMandata = 0
  41. end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement