Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function centerText(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- write(text)
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Choose your color!")
- print("Red, Blue, Yellow.")
- input = read()
- print("")
- term.setCursorPos(1,1)
- if input == "red" then
- while true do
- term.clear()
- print("On/Off")
- print("")
- input = read()
- term.setCursorPos(1,1)
- if input == "on" then
- term.clear()
- rs.setBundledOutput("back",colors.red)
- print("Red Activated")
- os.sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- end
- end
- elseif input == "off" then
- term.clear()
- rs.setBundledOutput("back",0)
- print("Red Deactivated")
- os.sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- end
- end
- end
- elseif input == "blue" then
- while true do
- term.clear()
- print("On/Off")
- print("")
- input = read()
- term.setCursorPos(1,1)
- if input == "on" then
- term.clear()
- rs.setBundledOutput("back",colors.blue)
- print("Blue Activated")
- os.sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- end
- end
- elseif input == "off" then
- term.clear()
- rs.setBundledOutput("back",0)
- print("Blue Deactivated")
- os.sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- end
- end
- end
- elseif input == "yellow" then
- term.clear()
- while true do
- term.clear()
- print("On/Off")
- print("")
- input = read()
- term.setCursorPos(1,1)
- if input == "on" then
- term.clear()
- rs.setBundledOutput("back",colors.yellow)
- print("Yellow Activated")
- os.sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- end
- end
- elseif input == "off" then
- term.clear()
- rs.setBundledOutput("back",0)
- print("Yellow Deactivated")
- os.sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- end
- end
- end
- elseif input == "debug" then
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Insert Password:")
- term.setCursorPos(17,1)
- input = read ("*")
- if input == "bacon" then
- term.clear()
- term.setCursorPos(1,1)
- print("Password correct!")
- os.sleep(1)
- term.clear()
- break
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Password incorrect!")
- sleep(2)
- end
- end
- end
- else print ("DA FUQ?!!?")
- end
- --term.clear()
- --centerText("What the hell are you on about?")
- --os.sleep(2)
- --end
- --end
- --end
Advertisement
Add Comment
Please, Sign In to add comment