Marlingaming

CC Tweaked CCSPS Iron - Install Finished - Account Setup

Jan 25th, 2022 (edited)
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. local Name = ""
  2. local Region = ""
  3. local Tax = 0
  4. local Access = 1
  5. local HAddress = ""
  6.  
  7. function CUI(m) --declare function
  8. n=1
  9. local l = #m
  10. while true do
  11. term.setCursorPos(1,5)
  12. for i=1, #m, 1 do --traverse the table of options
  13. if i==n then term.clearLine() print(i, ">",m[i]) else term.clearLine() print(i, "-", m[i]) end --print them
  14. end
  15. a, b= os.pullEvent("key") --wait for keypress
  16. if b==keys.w and n>1 then n=n-1 end
  17. if b==keys.s and n<=l then n=n+1 end
  18. if b==keys.enter then break end
  19. end
  20. return n --return the value
  21. end
  22.  
  23. local function Clear()
  24. term.clear()
  25. term.setCursorPos(1,1)
  26. end
  27.  
  28. function SaveData()
  29. local file = fs.open("os/System/Client/Files/.UserFile.txt","w")
  30. file.writeLine(Name)
  31. file.writeLine(Region)
  32. file.writeLine(Tax)
  33. file.writeLine(Access)
  34. file.writeLine(HAddress)
  35. file.close()
  36. end
  37.  
  38.  
  39. function Main()
  40. Clear()
  41. print("Hello! Thank you for using CCSPS")
  42. print("please enter Username, exactly")
  43. print("confirm")
  44. local User
  45. local event
  46. while true do
  47. local event = {os.pullEvent("key")}
  48. if event[2] == keys.enter then break end
  49. User = read()
  50. end
  51. Name = User
  52. Clear()
  53. print("excellent! Now please enter your Region")
  54. local options = {"Vedrana","Goldshelm","SaltFlats"}
  55. local n = CUI(options)
  56. Region = options[n]
  57. Main_2()
  58. end
  59.  
  60. function Main_2()
  61. Clear()
  62. print("please enter Ingame Address")
  63. print("if you do not know, put n")
  64. print("=Save=")
  65. local User
  66. local event
  67.  
  68. while true do
  69. local event = {os.pullEvent("key")}
  70. if event[2] == keys.enter then break end
  71. User = read()
  72. end
  73.  
  74. HAddress = User
  75. Clear()
  76. Main_3()
  77. end
  78.  
  79. function Main_3()
  80. Clear()
  81. print("now the final part, please select")
  82. print("Desired Package")
  83. local options = {"Save"}
  84. while true do
  85. local n = CUI(options)
  86. if options[n] == "Save" then break end
  87. end
  88. SaveData()
  89. Clear()
  90. end
  91.  
  92. if fs.exists("os/System/Client/Files/.UserFile.txt") == true then
  93.  
  94. else
  95. Main()
  96. end
  97.  
Add Comment
Please, Sign In to add comment