Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --========================================================--
- -- ROBCO INDUSTRIES (TM) UNIFIED OPERATING SYSTEM
- -- SECURE FUNCTIONS MODULE — UNLOCKED BY HACKING
- --========================================================--
- local secure = {}
- local ui = require("robco/ui")
- local speaker = require("robco/speaker")
- ------------------------------------------------------------
- -- MENU OPTIONS (DEFAULT FALLOUT STYLE)
- ------------------------------------------------------------
- local OPTIONS = {
- "UNLOCK DOOR",
- "DISABLE TURRETS",
- "ACTIVATE SECURITY PROTOCOLS",
- "DOWNLOAD LOGS",
- "SYSTEM DIAGNOSTICS",
- "SHUTDOWN TERMINAL"
- }
- ------------------------------------------------------------
- -- ACTION HANDLERS
- ------------------------------------------------------------
- local function action_unlockDoor()
- ui.drawHeader()
- term.setCursorPos(3, 10)
- print("DOOR UNLOCKED.")
- sleep(1.5)
- end
- local function action_disableTurrets()
- ui.drawHeader()
- term.setCursorPos(3, 10)
- print("TURRET SYSTEMS DISABLED.")
- sleep(1.5)
- end
- local function action_activateSecurity()
- ui.drawHeader()
- term.setCursorPos(3, 10)
- print("SECURITY PROTOCOLS ACTIVATED.")
- sleep(1.5)
- end
- local function action_downloadLogs()
- ui.drawHeader()
- term.setCursorPos(3, 10)
- print("DOWNLOADING LOGS...")
- sleep(1.5)
- term.setCursorPos(3, 11)
- print("TRANSFER COMPLETE.")
- sleep(1.5)
- end
- local function action_diagnostics()
- ui.drawHeader()
- term.setCursorPos(3, 10)
- print("RUNNING SYSTEM DIAGNOSTICS...")
- sleep(1.5)
- term.setCursorPos(3, 11)
- print("ALL SYSTEMS FUNCTIONAL.")
- sleep(1.5)
- end
- local function action_shutdown()
- ui.drawHeader()
- term.setCursorPos(3, 10)
- print("SHUTTING DOWN...")
- sleep(2)
- os.shutdown()
- end
- ------------------------------------------------------------
- -- OPTION DISPATCH TABLE
- ------------------------------------------------------------
- local ACTIONS = {
- [1] = action_unlockDoor,
- [2] = action_disableTurrets,
- [3] = action_activateSecurity,
- [4] = action_downloadLogs,
- [5] = action_diagnostics,
- [6] = action_shutdown
- }
- ------------------------------------------------------------
- -- SECURE MENU
- ------------------------------------------------------------
- function secure.openMenu()
- while true do
- ui.drawHeader()
- term.setCursorPos(3, 8)
- print("SECURE FUNCTIONS MENU:")
- local y = 10
- for i, opt in ipairs(OPTIONS) do
- term.setCursorPos(3, y)
- print(i .. ". " .. opt)
- y = y + 1
- end
- ui.prompt()
- local choice = tonumber(read())
- if choice and ACTIONS[choice] then
- ACTIONS[choice]()
- else
- ui.statusLine("INVALID SELECTION")
- sleep(1)
- end
- end
- end
- return secure
Advertisement
Add Comment
Please, Sign In to add comment