Advertisement
Simlor_GER

SimSoft 3.1 - SystemStart

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