SHARE
TWEET

SimSoft 3 - SystemStart

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