Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Name
- local Region
- local x, y, z
- local Tax
- local Access
- local HAddress
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function LoadUserAccount()
- settings.load(".settings")
- if settings.get("NetworkAccess") == true then
- else
- local file = fs.open("os/System/Client/Files/.UserFile.txt","r")
- Name = file.readLine()
- Region = file.readLine()
- Tax = file.readLine()
- Access = file.readLine()
- HAddress = file.readLine()
- file.close()
- end
- end
- 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
- function Interaction()
- local options = {"Front","Gov Profile","Properties","Tax information","Other","exit"}
- local n = CUI(options)
- Menus(options[n])
- end
- function Menus(menu)
- term.setBackgroundColor(colors.cyan)
- Clear()
- print("USER ACCOUNT")
- print("hello, ",Name)
- term.setCursorPos(1,11)
- if menu == "Front" then
- elseif menu == "Gov Profile" then
- print("Username = ",Name)
- print("Home Region = ",Region)
- elseif menu == "Properties" then
- print("Main Address = ",HAddress)
- elseif menu == "Tax information" then
- print("Base Tax = ",Tax)
- elseif menu == "Other" then
- print("Access Level = ",Access)
- end
- if menu == "exit" then
- else
- Interaction()
- end
- end
- LoadUserAccount()
- Menus("Front")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement