Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Chest tampering detection system
- -- 620eb42a98a955e79717d0f12d009c94a790d5b7
- local side = "left"
- local chest = peripheral.wrap(side)
- while true do
- local s = textutils.serialize(chest.list())
- local evt = os.pullEvent()
- if evt == "redstone" then
- if rs.getInput(side) then
- print("Chest opened")
- repeat sleep(0.5) until not rs.getInput(side)
- if s == textutils.serialize(chest.list()) then
- print("Chest closed, no items taken")
- else
- print("Chest tampered")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement