Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local on = true
- local start = {"+---------------+",
- "| START-UP |",
- "+---------------+",
- "| LOG-IN |",
- "| REGISTER |",
- "+---------------+"}
- local login = {"+---------------+",
- "| LOG-IN |",
- "+---------------+",
- "|USERNAME: ",
- "|PASSWORD: ",
- "+---------------+"}
- local reg = {"+---------------+",
- "| REGISTER |",
- "+---------------+",
- "|USERNAME: ",
- ":PASSWORD: ",
- "+---------------+"}
- local menu = {"+---------------+",
- "| MENU |",
- "+---------------+",
- "| EMAILS |",
- "| READ-EMAIL |",
- "| SEND-EMAIL |",
- "| LOGOUT |",
- "+---------------+"}
- local ems = {"+---------------+",
- "| EMAILS |",
- "+---------------+"}
- local send = {"+---------------+",
- "| SEND-EMAIL |",
- "+---------------+",
- "|TO: ",
- "+---------------+"}
- local read = {"+---------------+",
- "| READ-EMAIL |",
- "+---------------+",
- "|FROM: ",
- "|NUMBER: ",
- "+---------------+"}
- local cur = "start"
- local sec = 1
- local curemail
- local function getMax(cur)
- if cur == "start" then
- return 2
- elseif cur == "login" then
- return 2
- elseif cur == "reg" then
- return 2
- elseif cur == "menu" then
- return 4
- elseif cur == "ems" then
- return 0
- elseif cur == "send" then
- return 1
- elseif cur == "read" then
- return 2
- else
- return 0
- end
- end
- local function display(cur, selection)
- local data = nil
- local n = 0
- if cur == "start" then
- data = start
- if sec == 1 then
- data[4] = "| [LOG-IN] |"
- elseif sec == 2 then
- data[5] = "| [REGISTER] |"
- end
- elseif cur == "login" then
- data = login
- if sec == 1 then
- data[4] = "|[USERNAME]: "
- elseif sec == 2 then
- data[5] = "|[PASSWORD]: "
- end
- elseif cur == "reg" then
- data = reg
- if sec == 1 then
- data[4] = "|[USERNAME]: "
- elseif sec == 2 then
- data[5] = "|[PASSWORD]: "
- end
- elseif cur == "menu" then
- data = menu
- if sec == 1 then
- data[4] = "| [EMAILS] |"
- elseif sec == 2 then
- data[5] = "| [READ-EMAIL] |"
- elseif sec == 3 then
- data[6] = "| [SEND-EMAIL] |"
- elseif sec == 4 then
- data[7] = "| [LOGOUT] |"
- end
- elseif cur == "ems" then
- data = ems
- elseif cur == "send" then
- data = send
- if sec == 1 then
- data[4] = "|[TO]: "
- end
- elseif cur == "read" then
- data = read
- if sec == 1 then
- data[4] = "|[FROM]: "
- elseif sec == 2 then
- data[5] = "|[NUMBER]: "
- end
- end
- if data ~= nil then
- for i,v in ipairs(data) do
- print(v)
- end
- elseif curemail ~= nil then
- for i,v in ipairs(curemail) do
- print(v)
- end
- else
- on = false
- end
- end
- while on do
- term.clear()
- term.setCursorPos(1,1)
- display(cur, sec)
- if cur == "reading" then
- term.setCursorPos(1,1)
- end
- if cur == "writing" then
- end
- event, key = os.pullEvent()
- while key == nil do
- event, key = os.pullEvent()
- end
- if key ==
- sleep(1)
- end
- term.clear()
- term.setCursorPos(1,1)
Add Comment
Please, Sign In to add comment