Advertisement
Marlingaming

CCSPS IRON 2.5.0 - initial startup

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