Advertisement
Marlingaming

CC Tweaked CCSPS Iron - Account Page

Jan 25th, 2022 (edited)
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. local Name
  2. local Region
  3. local x, y, z
  4. local Tax
  5. local Access
  6. local HAddress
  7.  
  8. local function Clear()
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. end
  12.  
  13. local function LoadUserAccount()
  14. settings.load(".settings")
  15. if settings.get("NetworkAccess") == true then
  16.  
  17. else
  18. local file = fs.open("os/System/Client/Files/.UserFile.txt","r")
  19. Name = file.readLine()
  20. Region = file.readLine()
  21. Tax = file.readLine()
  22. Access = file.readLine()
  23. HAddress = file.readLine()
  24. file.close()
  25. end
  26. end
  27.  
  28. function CUI(m) --declare function
  29. n=1
  30. local l = #m
  31. while true do
  32. term.setCursorPos(1,5)
  33. for i=1, #m, 1 do --traverse the table of options
  34. if i==n then term.clearLine() print(i, ">",m[i]) else term.clearLine() print(i, "-", m[i]) end --print them
  35. end
  36. a, b= os.pullEvent("key") --wait for keypress
  37. if b==keys.w and n>1 then n=n-1 end
  38. if b==keys.s and n<=l then n=n+1 end
  39. if b==keys.enter then break end
  40. end
  41. return n --return the value
  42. end
  43.  
  44. function Interaction()
  45. local options = {"Front","Gov Profile","Properties","Tax information","Other","exit"}
  46. local n = CUI(options)
  47. Menus(options[n])
  48. end
  49.  
  50. function Menus(menu)
  51. term.setBackgroundColor(colors.cyan)
  52.  
  53. Clear()
  54. print("USER ACCOUNT")
  55. print("hello, ",Name)
  56. term.setCursorPos(1,11)
  57. if menu == "Front" then
  58.  
  59. elseif menu == "Gov Profile" then
  60. print("Username = ",Name)
  61. print("Home Region = ",Region)
  62. elseif menu == "Properties" then
  63. print("Main Address = ",HAddress)
  64. elseif menu == "Tax information" then
  65. print("Base Tax = ",Tax)
  66. elseif menu == "Other" then
  67. print("Access Level = ",Access)
  68. end
  69. if menu == "exit" then
  70.  
  71. else
  72. Interaction()
  73. end
  74. end
  75.  
  76. LoadUserAccount()
  77. Menus("Front")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement