SHARE
TWEET

SimSoft 3.1 - SystemStart

Simlor_GER May 16th, 2016 (edited) 623 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. --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.  
  35. local datei = http.get("http://pastebin.com/raw/LZch2Xnt")
  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 datei = http.get("http://pastebin.com/raw/"..CodePB)
  77.  datei = datei.readAll()
  78.  
  79.  local file = fs.open(Pfad, "w")
  80.  file.write(datei)
  81.  file.close()
  82. end
  83.  
  84. --Lade screen
  85.  
  86. term.setBackgroundColor(32768)
  87. term.setTextColor(128)
  88. term.clear()
  89. term.setCursorPos(1,1)
  90.  
  91. print(">Run SimSoft in version "..SS2V)
  92. print(">Pleas wait...")
  93.  
  94. --Updata Check
  95.  
  96. --Ausgesetzt
  97.  
  98.  
  99. --Rednet Check
  100.  
  101. if peripheral.getType("back") == "modem" then
  102.  rednet.open("back")
  103. end
  104.  
  105. if peripheral.getType("left") == "modem" then
  106.  rednet.open("left")
  107. end
  108.  
  109. if peripheral.getType("right") == "modem" then
  110.  rednet.open("right")
  111. end
  112.  
  113. if peripheral.getType("top") == "modem" then
  114.  rednet.open("top")
  115. end
  116.  
  117. if peripheral.getType("front") == "modem" then
  118.  rednet.open("front")
  119. end
  120.  
  121. if peripheral.getType("bottom") == "modem" then
  122.  rednet.open("bottom")
  123. end
  124.  
  125. --Functionen
  126.  
  127. function Clear()
  128.  term.clear()
  129.  term.setCursorPos(1,1)
  130. end
  131.  
  132. function CP(x,y)
  133.  term.setCursorPos(x,y)
  134. end
  135.  
  136. function TC(farbe)
  137.  term.setTextColor(farbe)
  138. end
  139.  
  140. function BC(farbe)
  141.  term.setBackgroundColor(farbe)
  142. end
  143.  
  144. function SimSoftBalken(titelzwei, titelzweilange)
  145.  w, h = term.getSize()
  146.  term.setBackgroundColor(32768)
  147.  TC(1)
  148.  
  149.  anz = 0
  150.  hig = 1
  151.  while true do
  152.   anz = (anz+1)
  153.   term.setCursorPos(anz, hig)
  154.   write(" ")
  155.   if anz == w then
  156.    if hig == 3 then
  157.     titelzweilange = (titelzweilange/2)
  158.     w = (w/2)
  159.     w = (w-titelzweilange)
  160.    
  161.     term.setCursorPos(w,2)
  162.     print(titelzwei)
  163.     break
  164.    else
  165.     hig = (hig+1)
  166.     anz = 0
  167.    end
  168.   end
  169.  end
  170. end
  171.  
  172. --End Functionen
  173.  
  174. --Start System (Passwort System)
  175.  
  176. file = fs.open("SimSoft/Daten/Config","r")
  177. local fileData = {}
  178. local line = file.readLine()
  179. repeat
  180. table.insert(fileData,line)
  181. line = file.readLine()
  182. until line == nil
  183. file.close()
  184.  
  185. PassSystem = fileData[1]
  186.  
  187. if PassSystem == "t" then
  188.  
  189.  --Pass System Desin
  190.  
  191.  BC(128)
  192.  Clear()
  193.  SimSoftBalken("SimSoft 3 - Login", 18)
  194.  
  195.  BC(128)
  196.  CP(4,7)
  197.  TC(1)
  198.  print("Login")
  199.  
  200.  function PassSS(nr)
  201.  
  202.   file = fs.open("SimSoft/Daten/User/User"..nr,"r")
  203.   local fileData = {}
  204.   local line = file.readLine()
  205.   repeat
  206.   table.insert(fileData,line)
  207.   line = file.readLine()
  208.   until line == nil
  209.   file.close()
  210.  
  211.   name = fileData[1]
  212.   pass = fileData[2]
  213.   ATF = fileData[3]
  214.  
  215.  end
  216.  
  217.  CP(5,9)
  218.  TC(256)
  219.  print("Username - ")
  220.  TC(32768)
  221.  
  222.  TC(256)
  223.  CP(5,11)
  224.  write("Password - ")
  225.  TC(32768)
  226.  
  227.  
  228.  CP(16,9)
  229.  namee = read()
  230.  CP(16,11)
  231.  passe = read("*")
  232.  
  233.  PassSS(1)
  234.  if namee == name then
  235.   if passe == pass then
  236.    function Rechte()
  237.     Recht = "Admin"
  238.     RechtH = 1
  239.    end
  240.    shell.run("SimSoft/System/Desktop")
  241.   else
  242.    TC(1)
  243.    CP(3,14)
  244.    print("Wrong name or password")
  245.    sleep(1.5)
  246.    os.reboot()
  247.   end
  248.  else
  249.  
  250.   PassSS(2)
  251.   if namee == name then
  252.    if ATF == "false" then
  253.     TC(1)
  254.     CP(3,14)
  255.     print("This account is offline")
  256.     sleep(1.5)
  257.     os.reboot()
  258.    elseif passe == pass then
  259.     function Rechte()
  260.      Recht = "Gast"
  261.      RechtH = 2
  262.     end
  263.     shell.run("SimSoft/System/Desktop")
  264.    else
  265.     TC(1)
  266.     CP(3,14)
  267.     print("Wrong name or password")
  268.     sleep(1.5)
  269.     os.reboot()
  270.    end
  271.   else
  272.  
  273.    PassSS(3)
  274.    if namee == name then
  275.     if ATF == "false" then
  276.     TC(1)
  277.     CP(3,14)
  278.     print("This account is offline")
  279.     sleep(1.5)
  280.     os.reboot()
  281.    elseif passe == pass then
  282.      function Rechte()
  283.       Recht = "Gast"
  284.       RechtH = 3
  285.      end
  286.      shell.run("SimSoft/System/Desktop")
  287.     else
  288.      TC(1)
  289.      CP(3,14)
  290.      print("Wrong name or password")
  291.      sleep(1.5)
  292.      os.reboot()
  293.     end
  294.    else
  295.     TC(1)
  296.     CP(3,14)
  297.     print("Wrong name or password")
  298.     sleep(1.5)
  299.     os.reboot()
  300.    end
  301.   end
  302.  end
  303.  
  304. else
  305.  function Rechte()
  306.   Recht = "Admin"
  307.   RechtH = 0
  308.  end
  309.  shell.run("SimSoft/System/Desktop")
  310. end
  311.  
  312. --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