Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- --LATO SENSORE, ROUTER E ID
- se = sensor.wrap("top")
- router_loc = "right"
- receiver_id = 3748
- --LATO ATTIVAZIONE REDSTONE QUANDO SQUILLA L'ALLARME
- lato = "left"
- ritardo = 0
- --GIOCATORI PER CUI L'ALLARME NON SI ATTIVA
- giocatore1 = "eternalcaos"
- giocatore2 = ""
- giocatore3 = ""
- rednet.open(router_loc)
- 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
- rednet.send(receiver_id, k)
- print("Player loggato")
- end
- else
- 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
Add Comment
Please, Sign In to add comment