os.loadAPI("touchpoint")
do
local main = touchpoint.new("top")
local rocket = touchpoint.new("top")
local security = touchpoint.new("top")
local facility = touchpoint.new("top")
local lockdown = touchpoint.new("top")
local login = touchpoint.new("top")
local t = login
local currentUser = "system"
local currentUserLabel = {
" " .. currentUser,
label = userLabel
}
local lockDownLabel = {
" ",
" (/) ",
" ",
label = "lockdownButton"
}
end
do
function login()
rs.setBundledOutput("right", 6)
sleep(3)
if rs.testBundledInput("right", colors.white) then
currentUser = "cox_11"
end
rs.setBundledOutput("right", 0)
main()
end
function exitToLogin()
t = login
currentUser = "system"
end
function rocket()
t = rocket
end
function security()
if currentUser == "cox_11" then
t = security
else
print(currentUser + " has attempted to access the Security Menu")
end
end
function facility()
t = facility
end
function main()
t = main
end
function lockdown()
t = lockdown
end
function lockdownStop()
if currentUser == nil then
exitToLogin()
else
main()
end
end
function mainDoorLock()
end
function turretToggle()
end
function loadItems()
end
function loadFuel()
end
function mainHatchToggle()
end
function launchRocket()
end
function lockdownStop()
login()
end
function reactor()
end
end
do
do
login:add("Login ->", login(), 21, 12, 30, 14) --This line is line 100!!!!!!! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
login:add("Lockdown ->", nil, 2, 2, 14, 11, colors.black)
end
do
main:add("Rocket Control", rocket(), 2, 2, 21, 6)
main:add("Security Control", security(), 2, 8, 21, 12)
main:add("Facility Control", facility(), 2, 14, 21, 18)
main:add("Logout", exitToLogin(), 40, 2, 47 2)
main:add("Current User:", nil, 2, 23, 21, 23, colors.black)
main:add(currentUserLabel, nil, 7 ,23, 21, 23)
end
do
security:add("Lock Main Door", mainDoorLock(), 2, 2, 21, 6)
security:add("Toggle Turrets", turretToggle(), 2, 8, 21, 12)
end
do
rocket:add("Load Items", loadItems(), 2, 2, 21, 6)
rocket:add("Load Fuel", loadFuel(), 2, 8, 21, 12)
rocket:add("Toggle Main Hatch", mainHatchToggle(), 2, 14, 21, 18)
rocket:add("LAUNCH", launchRocket(), 2, 20, 21, 26)
end
do
facility:add("Reactor", reactor(), 2, 2, 14, 11)
end
do
lockdown:add("Disable Lockdown", lockdownStop(), 2, 2, 11, 14)
end
end
function callButton(name)
if type(t.buttonList[name].func) == "function" then
t.buttonList[name].func()
end
end
while true do
t:add(lockDownLabel, lockdown(), 44, 23, 49, 26)
if not (t == main) then
t:add("Back", main(), 40, 2, 47, 2)
end
t:draw()
local event, p1 = t:handleEvents(os.pullEvent())
if event == "button_click" then
callButton(p1)
end
end