Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This program is designed to be used with the advanced door lock program I made. It can work standalone for other purposes
- -- Wiring Guide:
- -- Back:
- -- Yellow (input): Anti Tamper Line (have a fixed signal like a redstone block or torch always active)
- -- Purple (output): Alternate Alarm - Recommended for use to lockout other computers
- -- Orange (input): Alarm Trigger (for panic buttons/pressure plate traps)
- -- Top:
- -- Black (output): Sends a signal when the program starts (useful for keeping computers/buttons/whatever locked until this is booted)
- -- Bottom:
- -- Red (output): Security System/Main Alarm - Attach to sirens, security traps, lamps, whatever you want
- os.pullEvent = os.pullEventRaw
- -- Set this to whatever side you want. It's strictly output
- rs.setBundledOutput("top", colors.black)
- term.clear()
- alarm = 0
- status = ("Unknown")
- -- 1: green | 2: red
- severity = 0
- while true do
- term.setCursorPos(1,1)
- term.setTextColor(colors.orange)
- print("Redstone Alarm Panel V2")
- term.setTextColor(colors.yellow)
- term.setCursorPos(1,3)
- term.write("Status: ")
- if severity == 1 then
- term.setTextColor(colors.green)
- elseif severity == 2 then
- term.setTextColor(colors.red)
- else
- term.setTextColor(colors.yellow)
- end
- term.write(status)
- sleep(1)
- -- Anti Tamper System
- if redstone.testBundledInput("back", colors.yellow) == false then
- redstone.setBundledOutput("bottom", colors.red)
- severity = 2
- status = "Tamper Alert!"
- -- Checks for alarm trigger
- elseif redstone.testBundledInput("back", colors.orange) == true then
- redstone.setBundledOutput("bottom", colors.red)
- redstone.setBundledOutput("back", colors.purple)
- severity = 2
- status = "Red Alert! "
- else
- -- All clear
- redstone.setBundledOutput("bottom", 0)
- rs.setBundledOutput("back",0)
- severity = 1
- status = "All Clear "
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement