Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Name = ""
- local Access = 1
- function CUI(m) --declare function
- n=1
- local l = #m
- while true do
- term.setCursorPos(1,5)
- for i=1, #m, 1 do --traverse the table of options
- if i==n then term.clearLine() print(i, ">",m[i]) else term.clearLine() print(i, "-", m[i]) end --print them
- end
- a, b= os.pullEvent("key") --wait for keypress
- if b==keys.w and n>1 then n=n-1 end
- if b==keys.s and n<=l then n=n+1 end
- if b==keys.enter then break end
- end
- return n --return the value
- end
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function SaveData()
- local file = fs.open("os/System/Client/Files/.UserFile.txt","w")
- file.writeLine(Name)
- file.writeLine("*")
- file.writeLine("*")
- file.writeLine(Access)
- file.writeLine("*removed from 2.0.0")
- file.close()
- end
- function Main()
- Clear()
- print("Hello! Thank you for using CCSPS")
- print("please enter Username, exactly")
- print("confirm")
- local User
- local event
- while true do
- local event = {os.pullEvent("key")}
- if event[2] == keys.enter then break end
- User = read()
- end
- Name = User
- SaveData()
- Clear()
- end
- function Main_2()
- Clear()
- print("please enter Ingame Address")
- print("if you do not know, put n")
- print("=Save=")
- local User
- local event
- while true do
- local event = {os.pullEvent("key")}
- if event[2] == keys.enter then break end
- User = read()
- end
- Clear()
- Main_3()
- end
- function Main_3()
- Clear()
- print("now the final part, please select")
- print("Desired Package")
- local options = {"Save"}
- while true do
- local n = CUI(options)
- if options[n] == "Save" then break end
- end
- SaveData()
- Clear()
- end
- if fs.exists("os/System/Client/Files/.UserFile.txt") == true then
- else
- Main()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement