fallout-term/fallout.py

104 lines
3.7 KiB
Python
Raw Normal View History

2015-05-26 21:37:25 +00:00
#! /usr/bin/env python
import fallout_login as login
2015-05-27 01:11:31 +00:00
import fallout_boot as boot
import fallout_locked as locked
import fallout_hack as hack
2015-06-14 22:31:01 +00:00
import fallout_selection as select
import fallout_data as data
from fallout_functions import soundTest, queueIsEmpty, addSound
from time import sleep
import sys
2015-05-26 21:37:25 +00:00
hard = "--hard" in sys.argv
skip = "--skip" in sys.argv
2024-04-28 15:02:47 +00:00
if "--preload" in sys.argv:
soundTest()
try:
addSound("poweron")
while not queueIsEmpty():
sleep(0.2)
if skip or boot.beginBoot(hard):
while not queueIsEmpty():
sleep(0.2)
pwd = None
if not skip:
pwd = hack.beginLogin()
else:
pwd = "VERYVERYSECUREPASSWORD"
if pwd != None:
2024-04-28 15:02:47 +00:00
login.beginLogin(hard, "ADMIN", pwd)
while not queueIsEmpty():
sleep(0.2)
sel = 0
while sel != 3:
2024-04-28 15:02:47 +00:00
sel = select.beginSelection(
data.ROBCO_HEADERS,
data.SOFT_HEADERS,
data.MAIN_MENU,
data.MAIN_MSGS,
)
while not queueIsEmpty():
sleep(0.2)
2024-04-28 15:02:47 +00:00
if sel == 0:
loc = 0
while loc != 1:
2024-04-28 15:02:47 +00:00
MENU = [
data.LOCK_MENU[tog][data.LOCK_CONDS[tog]]
for tog in data.LOCK_CONDS.keys()
]
MSGS = [
data.LOCK_MSGS[tog][data.LOCK_CONDS[tog]]
for tog in data.LOCK_CONDS.keys()
]
loc = select.beginSelection(
data.ROBCO_HEADERS, data.SOFT_HEADERS, MENU, MSGS
)
if loc == 0:
2024-04-28 15:02:47 +00:00
if data.LOCK_CONDS["LOCKED"]:
data.LOCK_CONDS["LOCKED"] = 0
else:
2024-04-28 15:02:47 +00:00
data.LOCK_CONDS["LOCKED"] = 1
elif sel == 1:
tur = 0
while tur != 2:
2024-04-28 15:02:47 +00:00
MENU = [
data.TURRET_MENU[tog][data.TURRET_CONDS[tog]]
for tog in data.TURRET_CONDS.keys()
]
MSGS = [
data.TURRET_MSGS[tog][data.TURRET_CONDS[tog]]
for tog in data.TURRET_CONDS.keys()
]
tur = select.beginSelection(
data.TURRET_HEADERS, data.TURRET_HEADERS2, MENU, MSGS
)
if tur == 0:
data.TURRET_CONDS["TARGETING"] = 1
elif tur == 1:
2024-04-28 15:02:47 +00:00
if data.TURRET_CONDS["ENABLED"]:
data.TURRET_CONDS["ENABLED"] = 0
else:
2024-04-28 15:02:47 +00:00
data.TURRET_CONDS["ENABLED"] = 1
elif sel == 2:
log = 0
while log != data.LOG_RET_ID:
2024-04-28 15:02:47 +00:00
log = select.beginSelection(
data.ROBCO_HEADERS, data.SOFT_HEADERS, data.LOG_NAMES
)
if log != data.LOG_RET_ID:
LOG = data.LOGS[data.LOG_NAMES[log]].split("\n")
2024-04-28 15:02:47 +00:00
LOG.extend([""])
select.beginSelection(data.ROBCO_HEADERS, LOG, ["Return"])
else:
locked.beginLocked()
2024-04-28 15:02:47 +00:00
print("Login failed")
except KeyboardInterrupt:
pass
addSound("poweroff")
while not queueIsEmpty():
2024-04-28 15:02:47 +00:00
sleep(0.2)