Advertisement
Simlor_GER

SimSoft 3 - SystemStart

Mar 29th, 2016 (edited)
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. --Alle Rechte an SimSoft 3 sind "SimlorLP" (oder in Minecraft auch nur "Simlor") vorbehalten.
  2.  
  3. --OS Version und Sprache
  4.  
  5. file = fs.open("SimSoft/Daten/Config","r")
  6. local fileData = {}
  7. local line = file.readLine()
  8. repeat
  9. table.insert(fileData,line)
  10. line = file.readLine()
  11. until line == nil
  12. file.close()
  13. SS2V = fileData[3]
  14. Sprache = fileData[4]
  15.  
  16. --OS Update Function
  17.  
  18. local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30))
  19. local datei = http.get("https://pastebin.com/raw/LZch2Xnt" .. "?cb=" .. cacheBuster)
  20. datei = datei.readAll()
  21.  
  22. local file = fs.open("SimSoft/Daten/UpdateCheck/S","w")
  23. file.writeLine(datei)
  24. file.close()
  25.  
  26. file = fs.open("SimSoft/Daten/UpdateCheck/S","r")
  27. local fileData = {}
  28. local line = file.readLine()
  29. repeat
  30. table.insert(fileData,line)
  31. line = file.readLine()
  32. until line == nil
  33. file.close()
  34.  
  35. v = fileData[1]
  36.  
  37.  
  38. if v == SS2V then
  39. function UpdateC()
  40. UpdateCV = "true"
  41. end
  42. else
  43. function UpdateC()
  44. UpdateCV = "false"
  45. end
  46. end
  47.  
  48. fs.delete("SimSoft/Daten/UpdateCheck/S")
  49.  
  50. --Download Function
  51.  
  52. function Download(CodePB, Pfad)
  53. local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30))
  54. local datei = http.get("https://pastebin.com/raw/" .. textutils.urlEncode(CodePB) .. "?cb=" .. cacheBuster)
  55. datei = datei.readAll()
  56.  
  57. local file = fs.open(Pfad, "w")
  58. file.write(datei)
  59. file.close()
  60. end
  61.  
  62. --Lade screen
  63.  
  64. term.setBackgroundColor(32768)
  65. term.setTextColor(128)
  66. term.clear()
  67. term.setCursorPos(1,1)
  68.  
  69. print(">Run SimSoft in version "..SS2V)
  70. print(">Pleas wait...")
  71.  
  72. --Updata Check
  73.  
  74. --Ausgesetzt
  75.  
  76.  
  77. --Rednet Check
  78.  
  79. if peripheral.getType("back") == "modem" then
  80. rednet.open("back")
  81. end
  82.  
  83. if peripheral.getType("left") == "modem" then
  84. rednet.open("left")
  85. end
  86.  
  87. if peripheral.getType("right") == "modem" then
  88. rednet.open("right")
  89. end
  90.  
  91. if peripheral.getType("top") == "modem" then
  92. rednet.open("top")
  93. end
  94.  
  95. if peripheral.getType("front") == "modem" then
  96. rednet.open("front")
  97. end
  98.  
  99. if peripheral.getType("bottom") == "modem" then
  100. rednet.open("bottom")
  101. end
  102.  
  103. --Functionen
  104.  
  105. function Clear()
  106. term.clear()
  107. term.setCursorPos(1,1)
  108. end
  109.  
  110. function CP(x,y)
  111. term.setCursorPos(x,y)
  112. end
  113.  
  114. function TC(farbe)
  115. term.setTextColor(farbe)
  116. end
  117.  
  118. function BC(farbe)
  119. term.setBackgroundColor(farbe)
  120. end
  121.  
  122. --End Functionen
  123.  
  124. --Start System (Passwort System)
  125.  
  126. file = fs.open("SimSoft/Daten/Config","r")
  127. local fileData = {}
  128. local line = file.readLine()
  129. repeat
  130. table.insert(fileData,line)
  131. line = file.readLine()
  132. until line == nil
  133. file.close()
  134.  
  135. PassSystem = fileData[1]
  136.  
  137. if PassSystem == "t" then
  138.  
  139. --Pass System Desin
  140. BC(128)
  141. Clear()
  142.  
  143. BC(32768)
  144. CP(1,1)
  145. print(" ")
  146. print(" ")
  147. print(" ")
  148.  
  149. CP(17,2)
  150. TC(1)
  151. print("SimSoft 3 - Login")
  152.  
  153. BC(128)
  154. CP(4,7)
  155. TC(1)
  156. print("Login")
  157.  
  158. function PassSS(nr)
  159.  
  160. file = fs.open("SimSoft/Daten/User/User"..nr,"r")
  161. local fileData = {}
  162. local line = file.readLine()
  163. repeat
  164. table.insert(fileData,line)
  165. line = file.readLine()
  166. until line == nil
  167. file.close()
  168.  
  169. name = fileData[1]
  170. pass = fileData[2]
  171. ATF = fileData[3]
  172.  
  173. end
  174.  
  175. CP(5,9)
  176. TC(256)
  177. print("Username - ")
  178. TC(32768)
  179.  
  180. TC(256)
  181. CP(5,11)
  182. write("Password - ")
  183. TC(32768)
  184.  
  185.  
  186. CP(16,9)
  187. namee = read()
  188. CP(16,11)
  189. passe = read("*")
  190.  
  191. PassSS(1)
  192. if namee == name then
  193. if passe == pass then
  194. function Rechte()
  195. Recht = "Admin"
  196. RechtH = 1
  197. end
  198. shell.run("SimSoft/System/Desktop")
  199. else
  200. TC(1)
  201. CP(3,14)
  202. print("Wrong name or password")
  203. sleep(1.5)
  204. os.reboot()
  205. end
  206. else
  207.  
  208. PassSS(2)
  209. if namee == name then
  210. if ATF == "false" then
  211. TC(1)
  212. CP(3,14)
  213. print("This account is offline")
  214. sleep(1.5)
  215. os.reboot()
  216. elseif passe == pass then
  217. function Rechte()
  218. Recht = "Gast"
  219. RechtH = 2
  220. end
  221. shell.run("SimSoft/System/Desktop")
  222. else
  223. TC(1)
  224. CP(3,14)
  225. print("Wrong name or password")
  226. sleep(1.5)
  227. os.reboot()
  228. end
  229. else
  230.  
  231. PassSS(3)
  232. if namee == name then
  233. if ATF == "false" then
  234. TC(1)
  235. CP(3,14)
  236. print("This account is offline")
  237. sleep(1.5)
  238. os.reboot()
  239. elseif passe == pass then
  240. function Rechte()
  241. Recht = "Gast"
  242. RechtH = 3
  243. end
  244. shell.run("SimSoft/System/Desktop")
  245. else
  246. TC(1)
  247. CP(3,14)
  248. print("Wrong name or password")
  249. sleep(1.5)
  250. os.reboot()
  251. end
  252. else
  253. TC(1)
  254. CP(3,14)
  255. print("Wrong name or password")
  256. sleep(1.5)
  257. os.reboot()
  258. end
  259. end
  260. end
  261.  
  262. else
  263. function Rechte()
  264. Recht = "Admin"
  265. RechtH = 0
  266. end
  267. shell.run("SimSoft/System/Desktop")
  268. end
  269.  
  270. --End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement