Advertisement
Simlor_GER

SimSoft 2.1 (English) - SystemStart

Feb 26th, 2016 (edited)
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. --Alle Rechte an SimSoft 2.1 sind "SimlorLP" (oder in Minecraft auch nur "Simlor") vorbehalten.
  2.  
  3. --OS Version
  4.  
  5. function Version()
  6. file = fs.open("SimSoft/Daten/User","r")
  7. local fileData = {}
  8. local line = file.readLine()
  9. repeat
  10. table.insert(fileData,line)
  11. line = file.readLine()
  12. until line == nil
  13. file.close()
  14. SS2V = fileData[5]
  15. end
  16.  
  17. Version()
  18.  
  19. --Download Function
  20.  
  21. function Download(CodePB, Pfad)
  22. local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30))
  23. local datei = http.get("https://pastebin.com/raw/" .. textutils.urlEncode(CodePB) .. "?cb=" .. cacheBuster)
  24. datei = datei.readAll()
  25.  
  26. local file = fs.open(Pfad, "w")
  27. file.write(datei)
  28. file.close()
  29. end
  30.  
  31. --Lade screen
  32.  
  33. term.setBackgroundColor(32768)
  34. term.setTextColor(128)
  35. term.clear()
  36. term.setCursorPos(1,1)
  37.  
  38. print(">Run SimSoft in version "..SS2V)
  39. print(">Pleas wait...")
  40.  
  41. --Updata Check
  42.  
  43. Download("DrUiPUvq", "SimSoft/Daten/UpdateCheck/S")
  44.  
  45. file = fs.open("SimSoft/Daten/UpdateCheck/S","r")
  46. local fileData = {}
  47. local line = file.readLine()
  48. repeat
  49. table.insert(fileData,line)
  50. line = file.readLine()
  51. until line == nil
  52. file.close()
  53.  
  54. v = fileData[1]
  55.  
  56. if v == SS2V then
  57. function UpdataC()
  58. UpdataCV = true
  59. end
  60. else
  61. function UpdataC()
  62. UpdataCV = false
  63. end
  64. end
  65.  
  66. fs.delete("SimSoft/Daten/UpdateCheck/S")
  67.  
  68. --Rednet Check
  69.  
  70. if peripheral.getType("back") == "modem" then
  71. rednet.open("back")
  72. end
  73.  
  74. if peripheral.getType("left") == "modem" then
  75. rednet.open("left")
  76. end
  77.  
  78. if peripheral.getType("right") == "modem" then
  79. rednet.open("right")
  80. end
  81.  
  82. if peripheral.getType("top") == "modem" then
  83. rednet.open("top")
  84. end
  85.  
  86. if peripheral.getType("front") == "modem" then
  87. rednet.open("front")
  88. end
  89.  
  90. if peripheral.getType("bottom") == "modem" then
  91. rednet.open("bottom")
  92. end
  93.  
  94. --Functionen
  95.  
  96. function Clear()
  97. term.clear()
  98. term.setCursorPos(1,1)
  99. end
  100.  
  101. function CP(x,y)
  102. term.setCursorPos(x,y)
  103. end
  104.  
  105. function TC(farbe)
  106. term.setTextColor(farbe)
  107. end
  108.  
  109. function BC(farbe)
  110. term.setBackgroundColor(farbe)
  111. end
  112.  
  113. --End Functionen
  114.  
  115. --Start System (Passwort System)
  116.  
  117. file = fs.open("SimSoft/Daten/User","r")
  118. local fileData = {}
  119. local line = file.readLine()
  120. repeat
  121. table.insert(fileData,line)
  122. line = file.readLine()
  123. until line == nil
  124. file.close()
  125.  
  126. hint = fileData[3]
  127.  
  128. if hint == "t" then
  129.  
  130. --Pass System Desin
  131. BC(128)
  132. Clear()
  133.  
  134. BC(32768)
  135. CP(1,1)
  136. print(" ")
  137. print(" ")
  138. print(" ")
  139.  
  140. CP(15,2)
  141. TC(1)
  142. print("SimSoft 2.1 - Login")
  143.  
  144. BC(128)
  145. CP(4,7)
  146. TC(1)
  147. print("Login")
  148.  
  149. file = fs.open("SimSoft/Daten/User","r")
  150. local fileData = {}
  151. local line = file.readLine()
  152. repeat
  153. table.insert(fileData,line)
  154. line = file.readLine()
  155. until line == nil
  156. file.close()
  157.  
  158. name = fileData[1]
  159. passr = fileData[2]
  160.  
  161.  
  162. CP(5,9)
  163. TC(256)
  164. write("Username - ")
  165. TC(32768)
  166. print(name)
  167.  
  168. TC(256)
  169. CP(5,11)
  170. write("Password - ")
  171. TC(32768)
  172. passe = read("*")
  173.  
  174. if passe == passr then
  175. shell.run("SimSoft/System/Desktop")
  176. else
  177. term.setCursorPos(5,14)
  178. BC(128)
  179. TC(256)
  180. print("Wrong password.")
  181. sleep(0.6)
  182. shell.run("SimSoft/System/SystemStart")
  183. end
  184.  
  185. else
  186. shell.run("SimSoft/System/Desktop")
  187. end
  188.  
  189. --End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement