View difference between Paste ID: 4XKzHCaw and 0Y2tAXw6
SHOW: | | - or go back to the newest paste.
1-
sleep(5)
1+
rednet.open("left")
2
3
os.loadAPI("ocs/apis/sensor")
4
5
-- ID PC LOG
6
logpc = 4682
7
8
-- MERDOR ID
9
mid = 1
10
11
--LATO SENSORE
12
se = sensor.wrap("top")
13
 
14
--LATO ATTIVAZIONE REDSTONE QUANDO SQUILLA L'ALLARME
15
lato = "back"
16
ritardo = 0
17
18
--GIOCATORI PER CUI L'ALLARME NON SI ATTIVA
19
giocatore1 = "djcrash01"
20
giocatore2 = "LORDMALARIA1"
21
giocatore3 = ""
22
giocatore4 = ""
23
24
rs.setOutput(lato, true)
25
os.loadAPI("ocs/apis/sensor")
26
while true do
27
local rsout = rs.getInput("front")
28
ta = se.getTargets()
29
for k,v in pairs(ta) do
30
if v["Name"] == "Player" and k ~= "lego11" and k ~= giocatore1 and k ~= giocatore2 and k ~= giocatore3 and k ~= giocatore4 and k ~= "FoxWorn3365" then
31
print("Rilevato giocatore non autorizzato: "..k)
32
rednet.send(logpc, "["..mid.."] Rilevato giocatore: "..k)
33
if rsout == true then
34
rs.setOutput(lato, false)
35
sleep(0.1)
36
rs.setOutput(lato, true)
37
print("Zappato!")
38
end
39
end
40
sleep(2)
41
end
42
end