Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Screen/Drawing functions
- -----------------------------
- w,h = term.getSize()
- hW = w/2
- hH = h/2
- c=colors.combine(colors.red,colors.green,colors.black,colors.white)
- white = false
- green = false
- black = false
- red = false
- rs.setBundledOutput("back", c)
- function centerPrint(y,text)
- term.setCursorPos(w/2 - #text/2, y)
- term.write(text)
- end
- function drawAt(x,y,text)
- term.setCursorPos(x,y)
- write(text)
- end
- function cleanScreen()
- term.clear()
- term.setCursorPos(1,1)
- end
- input = 1
- function drawArt()
- cleanScreen()
- term.setTextColor(colors.lime)
- term.setBackgroundColor(colors.black) --title and title background color
- print[[
- VAULT-TEC REACTOR MK 4 CONTROL STATION
- AUTHORIZED PERSONEL ONLY!
- ]]
- for i = 5,19 do
- term.setBackgroundColor(colors.black) -- MAIN BACKGROUND SPAM COLOR
- drawAt(1,i," ")
- term.setBackgroundColor(colors.black)
- end
- if input == nil then
- input = 1
- end
- term.setBackgroundColor(colors.black) -- menu section background
- term.setTextColor(colors.red) -- menu section brackets
- term.setCursorPos(9,(input + 5))
- print("[")
- term.setCursorPos(40,(input + 5))
- print("]")
- term.setBackgroundColor(colors.black)
- options = {
- " ",
- " ACTIVATE REACTORS 01-06 ",
- " DEACTIVATE REACTORS 01-06 ",
- " ACTIVATE REACTORS 07-12 ",
- " DEACTIVATE REACTORS 07-12 ",
- " ACTIVATE BREEDER CORE 1 ",
- " DEACTIVATE BREEDER CORE 1 ",
- " ACTIVATE BREEDER CORE 2 ",
- " DEACTIVATE BREEDER CORE 2 ",
- " -EMERGENCY- CORE SHUTDOWN ",
- " ",
- }
- for i = 1, #options do
- term.setBackgroundColor(colors.black) -- options background color
- term.setTextColor(colors.blue) -- options text color
- drawAt(10,i + 4,options[i])
- end
- term.setTextColor(colors.red) -- option text color optional
- drawAt(10,14," -EMERGENCY- CORE SHUTDOWN ")
- end
- function events()
- evt, but = os.pullEvent()
- if evt == "key" then
- if but == 208 then --down arrow
- input = input + 1
- if input > 9 then
- input = 9
- end
- elseif but == 200 then --up arrow
- input = input - 1
- if input < 1 then
- input = 1
- end
- elseif but == 28 then --Enter
- if input == 1 then
- c = colors.subtract(c, colors.white)
- rs.setBundledOutput("back",c)
- white = not white
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* ACTIVATED REACTORS 01-06 *")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- elseif input == 2 then
- c = colors.combine(c, colors.white)
- rs.setBundledOutput("back",c)
- white = not white
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* DEACTIVATED REACTORS 01-06 *")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- elseif input == 3 then
- c = colors.subtract(c, colors.black)
- rs.setBundledOutput("back",c)
- black = not black
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* ACTIVATED REACTORS 07-12 *")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- elseif input == 4 then
- c = colors.combine(c, colors.black)
- rs.setBundledOutput("back",c)
- black = not black
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* ACTIVATED REACTORS 07-12 *")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- elseif input == 5 then
- c = colors.subtract(c, colors.red)
- rs.setBundledOutput("back",c)
- red = not red
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* ACTIVATED BREEDER CORE 1* ")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- elseif input == 6 then
- c = colors.combine(c, colors.red)
- rs.setBundledOutput("back",c)
- red = not red
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* DEACTIVATED BREEDER CORE 1 *")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- elseif input == 7 then
- c = colors.subtract(c, colors.green)
- rs.setBundledOutput("back",c)
- green = not green
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* ACTIVATED BREEDER CORE 2 *")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- elseif input == 8 then
- c = colors.combine(c, colors.green)
- rs.setBundledOutput("back", c)
- green = not green
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* DEACTIVATED BREEDER CORE 2 *")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- elseif input == 9 then
- c = colors.combine(colors.green,colors.red,colors.white,colors.black)
- green = false
- red = false
- black = false
- white = false
- rs.setBundledOutput("back", c)
- term.clear()
- term.setCursorPos(9,9)
- print("********************************")
- term.setCursorPos(9,10)
- print("* EMERGENCY SHUTDOWN INITIATED *")
- term.setCursorPos(9,11)
- print("********************************")
- sleep(3)
- end
- end
- end
- end
- function main()
- while true do
- cleanScreen()
- drawArt()
- events() --Handles the menu stuff
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement