Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- NewOS 1.0
- term.clear()
- term.setCursorPos(1,1)
- _ver = "1,1"
- OSname = "NewOS "
- loginchoise = "false"
- registerchoise = "true"
- yeschoise = "false"
- nochoise = "true"
- -- defining cPrint function!
- local function cPrint(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- print(text)
- end
- function yN()
- local n=1
- while true do
- local x, y=term.getCursorPos()
- term.clearLine()
- if n==1 then cPrint("| -> Login <- Register |") else cPrint("| Login -> Register <- |") end
- term.setCursorPos(x, y)
- a, b=os.pullEvent()
- while a~="key" do a, b=os.pullEvent() end
- if b==203 and n==2 then n=1 end
- if b==205 and n==1 then n=2 end
- if b==29 then print("") break end
- end
- if n==1 then loginchoise = true end
- if n==2 then registerchoise = false end
- return false
- end
- yN()
Add Comment
Please, Sign In to add comment