Posted 02 April 2013 - 12:21 AM
So here's the situation; I have a reactor control program that I've been tinkering with and I really like. but I'd like to make it an actual 'menu' with scroll up/down options instead of just 'input the number to get the effect.' Here's what I have so far: (And yes, this is a 'fallout' based world. XD)
http://pastebin.com/YKYnazTS
So, how do I make this a menu where you scroll up and down over the options, instead of having to type something in manually? the examples I find online don't seem to be much help.
Spoiler
c = colors.combine(colors.red,colors.black,colors.white,colors.green)
white = false
black = false
green = false
red = false
rs.setBundledOutput("back", c)
while true do
term.clear()
term.setTextColor(colors.lime)
term.setCursorPos(1,1)
print("**************************************************")
print("***** VAULT-TEC REACTOR MK 4 CONTROL STATION *****")
print("***** AUTHORIZED PERSONEL ONLY! *****")
print("**************************************************")
i=1
while i <= 13 do
term.setCursorPos(1,i+4)
print("***** *****")
i=i+1
end
print("**************************************************")
term.setCursorPos(7,15)
print("**************************************************")
term.setTextColor(colors.blue)
term.setCursorPos(7,5)
print(" [1] ACTIVATE REACTORS 1 - 3")
term.setCursorPos(7,6)
print(" [2] DEACTIVATE REACTORS 1 - 3")
term.setCursorPos(7,7)
print(" [3] ACTIVATE REACTORS 4 - 6")
term.setCursorPos(7,8)
print(" [4] DEACTIVATE REACTORS 4 - 6")
term.setCursorPos(7,9)
print(" [5] ACTIVATE BREEDER CORE 1")
term.setCursorPos(7,10)
print(" [6] DEACTIVATE BREEDER CORE 1")
term.setCursorPos(7,11)
print(" [7] ACTIVATE BREEDER CORE 2")
term.setCursorPos(7,12)
print(" [8] DEACTIVATE BREEDER CORE 2")
term.setCursorPos(7,13)
term.setTextColor(colors.red)
print(" [0] -EMERGENCY- CORE SHUTDOWN")
term.setTextColor(colors.blue)
term.setCursorPos(7,17)
print(" ENTER CHOICE: [ ]")
term.setCursorPos(23,17)
input = read()
if input == "1" then
c = colors.subtract(c, colors.white)
rs.setBundledOutput("back",c)
white = not white
end
if input == "2" then
c = colors.combine(c, colors.white)
rs.setBundledOutput("back",c)
white = not white
end
if input == "3" then
c = colors.subtract(c, colors.black)
rs.setBundledOutput("back",c)
black = not black
end
if input == "4" then
c = colors.combine(c, colors.black)
rs.setBundledOutput("back",c)
black = not black
end
if input == "5" then
c = colors.subtract(c, colors.red)
rs.setBundledOutput("back",c)
red = not red
end
if input == "6" then
c = colors.combine(c, colors.red)
rs.setBundledOutput("back",c)
red = not red
end
if input == "7" then
c = colors.subtract(c, colors.green)
rs.setBundledOutput("back",c)
green = not green
end
if input == "8" then
c = colors.combine(c, colors.green)
rs.setBundledOutput("back", c)
green = not green
end
if input == "0" then
c = colors.combine(colors.green,colors.red,colors.white,colors.black)
green = false
red = false
black = false
white = false
rs.setBundledOutput("back", c)
end
end
So, how do I make this a menu where you scroll up and down over the options, instead of having to type something in manually? the examples I find online don't seem to be much help.