Simlor_GER

SimSoft 3.1 - AcManager

May 16th, 2016
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.06 KB | None | 0 0
  1. --Alle Rechte an SimSoft 3 sind "SimlorLP" (oder in Minecraft auch nur "Simlor") vorbehalten.
  2.  
  3. --AcManager
  4.  
  5. backD = false
  6. AC = 0
  7.  
  8. while true do
  9.  
  10. Rechte()
  11.  
  12. file = fs.open("SimSoft/Daten/Config","r")
  13. local fileData = {}
  14. local line = file.readLine()
  15. repeat
  16. table.insert(fileData,line)
  17. line = file.readLine()
  18. until line == nil
  19. file.close()
  20.  
  21. PassSOO = fileData[1]
  22. Hintergrund = fileData[2]
  23. Version = fileData[3]
  24. Sprache = fileData[4]
  25. --
  26. file = fs.open("SimSoft/Daten/User/User1","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. u1 = fileData[1]
  36. p1 = fileData[2]
  37. --
  38. file = fs.open("SimSoft/Daten/User/User2","r")
  39. local fileData = {}
  40. local line = file.readLine()
  41. repeat
  42. table.insert(fileData,line)
  43. line = file.readLine()
  44. until line == nil
  45. file.close()
  46.  
  47. u2 = fileData[1]
  48. p2 = fileData[2]
  49. ACTF2 = fileData[3]
  50. --
  51. file = fs.open("SimSoft/Daten/User/User3","r")
  52. local fileData = {}
  53. local line = file.readLine()
  54. repeat
  55. table.insert(fileData,line)
  56. line = file.readLine()
  57. until line == nil
  58. file.close()
  59.  
  60. u3 = fileData[1]
  61. p3 = fileData[2]
  62. ACTF3 = fileData[3]
  63. --
  64.  
  65. BC(128)
  66. Clear()
  67.  
  68. SimSoftBalken("SimSoft 3 - AcManager", 21)
  69.  
  70. BC(128)
  71.  
  72. w, h = term.getSize()
  73.  
  74. wa = (w-6)
  75.  
  76. CP(wa,5)
  77. TC(32)
  78. if Recht == "Gast" then
  79. recht = " User"
  80. elseif Recht == "Admin" then
  81. recht = "Admin"
  82. end
  83. print(recht)
  84.  
  85. if AC == 0 then
  86. BC(128)
  87. CP(1,6)
  88. print(" ")
  89. print(" ")
  90. print(" ")
  91. print(" ")
  92. print(" ")
  93. print(" ")
  94. print(" ")
  95. print(" ")
  96. print(" ")
  97. print(" ")
  98.  
  99. BC(256)
  100. TC(1)
  101. CP(3,6)
  102. print(" Choose an account ")
  103.  
  104.  
  105. w, h = term.getSize()
  106. h = (h-1)
  107. BC(128)
  108. TC(1)
  109. CP(3,h)
  110. print("Desktop")
  111.  
  112. while true do
  113. event,side,x,y = os.pullEvent()
  114. if event == "mouse_click" then
  115.  
  116. if x >= 3 and x <= 9 and y == h then
  117. backD = true
  118. break
  119. end
  120.  
  121. if x >= 3 and x <= 21 and y == 6 then
  122. TC(1)
  123. CP(3,6)
  124. BC(256)
  125. print(" Choose an account ")
  126. TC(256)
  127. BC(1)
  128. CP(3,7)
  129. print(" ")
  130. TC(1)
  131. BC(256)
  132. CP(3,8)
  133. print(" Account 1 - Adm. ")
  134. TC(256)
  135. BC(1)
  136. CP(3,9)
  137. print(" Account 2 ")
  138. TC(1)
  139. BC(256)
  140. CP(3,10)
  141. print(" Account 3 ")
  142.  
  143. while true do
  144. event,side,x,y = os.pullEvent()
  145. if event == "mouse_click" then
  146.  
  147. if x >= 3 and x <= 21 and y == 8 then
  148. AC = 1
  149. break
  150. elseif x >= 3 and x <= 21 and y == 9 then
  151. AC = 2
  152. break
  153. elseif x >= 3 and x <= 21 and y == 10 then
  154. AC = 3
  155. break
  156. elseif x >= 3 and x <= 21 and y >= 11 and y <= 19 or x >= 1 and x <= 51 and y >= 1 and y <= 5 or x >= 1 and x <= 2 and y >= 1 and y <= 19 or x >= 22 and x <= 51 and y >= 1 and y <= 19 then
  157. AC = 0
  158. break
  159. end
  160. end
  161. end
  162. end
  163. break
  164. end
  165. end
  166.  
  167. elseif AC == 1 then
  168. BC(128)
  169. CP(1,6)
  170. print(" ")
  171. print(" ")
  172. print(" ")
  173. print(" ")
  174. print(" ")
  175. print(" ")
  176. print(" ")
  177. print(" ")
  178. print(" ")
  179. print(" ")
  180.  
  181. BC(256)
  182. TC(1)
  183. CP(3,6)
  184. print(" Account 1 - Admin ")
  185.  
  186. w, h = term.getSize()
  187. h = (h-1)
  188. BC(128)
  189. TC(1)
  190. CP(3,h)
  191. print("Desktop")
  192.  
  193. BC(128)
  194. TC(1)
  195. CP(4,9)
  196. write("Edit name")
  197. TC(256)
  198. print(" - "..u1)
  199.  
  200. BC(128)
  201. TC(1)
  202. CP(4,11)
  203. write("Edit password")
  204. TC(256)
  205. print(" - ******")
  206.  
  207. CP(4, 13)
  208. BC(128)
  209. TC(256)
  210. print("Login on/off")
  211.  
  212. if PassSOO == "t" then
  213. CP(18,13)
  214. if Recht == "Admin" then
  215. BC(2048)
  216. write(" ")
  217. BC(32768)
  218. print(" ")
  219. else
  220. BC(16384)
  221. write(" ")
  222. BC(32768)
  223. print(" ")
  224. end
  225. else
  226. CP(18,13)
  227. if Recht == "Admin" then
  228. BC(32768)
  229. write(" ")
  230. BC(256)
  231. print(" ")
  232. else
  233. BC(32768)
  234. write(" ")
  235. BC(16384)
  236. print(" ")
  237. end
  238. end
  239.  
  240. while true do
  241. event,side,x,y = os.pullEvent()
  242. if event == "mouse_click" then
  243.  
  244. if x >= 18 and x <= 20 and y == 13 then
  245. if Recht == "Admin" then
  246. if PassSOO == "t" then
  247. PassSOO = "f"
  248. else
  249. PassSOO = "t"
  250. end
  251.  
  252. local file = fs.open("SimSoft/Daten/Config","w")
  253. file.close()
  254. local file = fs.open("SimSoft/Daten/Config","w")
  255. file.writeLine(PassSOO)
  256. file.writeLine(Hintergrund)
  257. file.writeLine(Version)
  258. file.writeLine(Sprache)
  259. file.close()
  260. end
  261. end
  262.  
  263. if x >= 3 and x <= 9 and y == h then
  264. backD = true
  265. break
  266. end
  267.  
  268. if x >= 4 and x <= 12 and y == 9 then
  269.  
  270. if Recht == "Admin" then
  271. BC(128)
  272. CP(16,9)
  273. TC(256)
  274. print(" ")
  275. CP(16,9)
  276. nname = read()
  277.  
  278. local file = fs.open("SimSoft/Daten/User/User1","w")
  279. file.close()
  280. local file = fs.open("SimSoft/Daten/User/User1","w")
  281. file.writeLine(nname)
  282. file.writeLine(p1)
  283. file.close()
  284. CP(16,9)
  285. TC(32)
  286. print("Saved!")
  287. sleep(0.2)
  288. break
  289. else
  290. CP(16,9)
  291. BC(128)
  292. TC(16384)
  293. print("You are not a admin ")
  294. sleep(1)
  295. break
  296. end
  297. end
  298.  
  299. if x >= 4 and x <= 16 and y == 11 then
  300.  
  301. if Recht == "Admin" then
  302. BC(128)
  303. CP(20,11)
  304. TC(256)
  305. print(" ")
  306. CP(20,11)
  307. npass = read("*")
  308.  
  309. local file = fs.open("SimSoft/Daten/User/User1","w")
  310. file.close()
  311. local file = fs.open("SimSoft/Daten/User/User1","w")
  312. file.writeLine(u1)
  313. file.writeLine(npass)
  314. file.close()
  315. CP(20,11)
  316. TC(32)
  317. print("Saved! ")
  318. sleep(0.2)
  319. break
  320. else
  321. CP(20,11)
  322. BC(128)
  323. TC(16384)
  324. print("You are not a admin ")
  325. sleep(1)
  326. break
  327. end
  328. end
  329.  
  330.  
  331. if x >= 3 and x <= 21 and y == 6 then
  332. TC(1)
  333. CP(3,6)
  334. BC(256)
  335. write(" Choose an account ")
  336. BC(128)
  337. print(" ")
  338. TC(256)
  339. BC(1)
  340. CP(3,7)
  341. print(" ")
  342. TC(1)
  343. BC(256)
  344. CP(3,8)
  345. print(" Account 1 - Adm. ")
  346. TC(256)
  347. BC(1)
  348. CP(3,9)
  349. print(" Account 2 ")
  350. TC(1)
  351. BC(256)
  352. CP(3,10)
  353. print(" Account 3 ")
  354.  
  355. while true do
  356. event,side,x,y = os.pullEvent()
  357. if event == "mouse_click" then
  358.  
  359. if x >= 3 and x <= 21 and y == 8 then
  360. AC = 1
  361. break
  362. elseif x >= 3 and x <= 21 and y == 9 then
  363. AC = 2
  364. break
  365. elseif x >= 3 and x <= 21 and y == 10 then
  366. AC = 3
  367. break
  368. elseif x >= 3 and x <= 21 and y >= 11 and y <= 19 or x >= 1 and x <= 51 and y >= 1 and y <= 5 or x >= 1 and x <= 2 and y >= 1 and y <= 19 or x >= 22 and x <= 51 and y >= 1 and y <= 19 then
  369. AC = 1
  370. break
  371. end
  372. end
  373. end
  374. end
  375. break
  376. end
  377. end
  378.  
  379. elseif AC == 2 then
  380. BC(128)
  381. CP(1,6)
  382. print(" ")
  383. print(" ")
  384. print(" ")
  385. print(" ")
  386. print(" ")
  387. print(" ")
  388. print(" ")
  389. print(" ")
  390. print(" ")
  391. print(" ")
  392.  
  393. BC(256)
  394. TC(1)
  395. CP(3,6)
  396. print(" Account 2 ")
  397.  
  398. w, h = term.getSize()
  399. h = (h-1)
  400. BC(128)
  401. TC(1)
  402. CP(3,h)
  403. print("Desktop")
  404.  
  405. BC(128)
  406. TC(1)
  407. CP(4,9)
  408. write("Edit name")
  409. TC(256)
  410. print(" - "..u2)
  411.  
  412. BC(128)
  413. TC(1)
  414. CP(4,11)
  415. write("Edit password")
  416. TC(256)
  417. print(" - ******")
  418.  
  419. if ACTF2 == "true" then
  420. CP(15,6)
  421. if Recht == "Admin" then
  422. BC(2048)
  423. write(" ")
  424. BC(32768)
  425. print(" ")
  426. else
  427. BC(16384)
  428. write(" ")
  429. BC(32768)
  430. print(" ")
  431. end
  432. else
  433. CP(15,6)
  434. if Recht == "Admin" then
  435. BC(32768)
  436. write(" ")
  437. BC(256)
  438. print(" ")
  439. else
  440. BC(32768)
  441. write(" ")
  442. BC(16384)
  443. print(" ")
  444. end
  445. end
  446.  
  447. while true do
  448. event,side,x,y = os.pullEvent()
  449. if event == "mouse_click" then
  450.  
  451. if x >= 15 and x <= 17 and y == 6 then
  452. if Recht == "Admin" then
  453. if ACTF2 == "true" then
  454. ACTF2 = "false"
  455. else
  456. ACTF2 = "true"
  457. end
  458.  
  459. local file = fs.open("SimSoft/Daten/User/User2","w")
  460. file.close()
  461. local file = fs.open("SimSoft/Daten/User/User2","w")
  462. file.writeLine(u2)
  463. file.writeLine(p2)
  464. file.writeLine(ACTF2)
  465. file.close()
  466. end
  467. end
  468.  
  469. if x >= 3 and x <= 9 and y == h then
  470. backD = true
  471. break
  472. end
  473.  
  474. if x >= 4 and x <= 12 and y == 9 then
  475.  
  476. if Recht == "Admin" or RechtH == 2 then
  477. BC(128)
  478. CP(16,9)
  479. TC(256)
  480. print(" ")
  481. CP(16,9)
  482. nname = read()
  483.  
  484. local file = fs.open("SimSoft/Daten/User/User2","w")
  485. file.close()
  486. local file = fs.open("SimSoft/Daten/User/User2","w")
  487. file.writeLine(nname)
  488. file.writeLine(p2)
  489. file.writeLine(ACTF2)
  490. file.close()
  491. CP(16,9)
  492. TC(32)
  493. print("Saved! ")
  494. sleep(0.2)
  495. break
  496. else
  497. CP(16,9)
  498. BC(128)
  499. TC(16384)
  500. print("You are not a user 2 ")
  501. sleep(1)
  502. break
  503. end
  504. end
  505.  
  506. if x >= 4 and x <= 16 and y == 11 then
  507.  
  508. if Recht == "Admin" or RechtH == 2 then
  509. BC(128)
  510. CP(20,11)
  511. TC(256)
  512. print(" ")
  513. CP(20,11)
  514. npass = read("*")
  515.  
  516. local file = fs.open("SimSoft/Daten/User/User2","w")
  517. file.close()
  518. local file = fs.open("SimSoft/Daten/User/User2","w")
  519. file.writeLine(u2)
  520. file.writeLine(npass)
  521. file.writeLine(ACTF2)
  522. file.close()
  523. CP(20,11)
  524. TC(32)
  525. print("Saved! ")
  526. sleep(0.2)
  527. break
  528. else
  529. CP(20,11)
  530. BC(128)
  531. TC(16384)
  532. print("You are not a user 2 ")
  533. sleep(1)
  534. break
  535. end
  536. end
  537.  
  538.  
  539. if x >= 3 and x <= 13 and y == 6 then
  540. TC(1)
  541. CP(3,6)
  542. BC(256)
  543. print(" Choose an account ")
  544. TC(256)
  545. BC(1)
  546. CP(3,7)
  547. print(" ")
  548. TC(1)
  549. BC(256)
  550. CP(3,8)
  551. print(" Account 1 - Adm. ")
  552. TC(256)
  553. BC(1)
  554. CP(3,9)
  555. print(" Account 2 ")
  556. TC(1)
  557. BC(256)
  558. CP(3,10)
  559. print(" Account 3 ")
  560.  
  561. while true do
  562. event,side,x,y = os.pullEvent()
  563. if event == "mouse_click" then
  564.  
  565. if x >= 3 and x <= 21 and y == 8 then
  566. AC = 1
  567. break
  568. elseif x >= 3 and x <= 21 and y == 9 then
  569. AC = 2
  570. break
  571. elseif x >= 3 and x <= 21 and y == 10 then
  572. AC = 3
  573. break
  574. elseif x >= 3 and x <= 21 and y >= 11 and y <= 19 or x >= 1 and x <= 51 and y >= 1 and y <= 5 or x >= 1 and x <= 2 and y >= 1 and y <= 19 or x >= 22 and x <= 51 and y >= 1 and y <= 19 then
  575. AC = 2
  576. break
  577. end
  578. end
  579. end
  580. end
  581. break
  582. end
  583. end
  584.  
  585. elseif AC == 3 then
  586. BC(128)
  587. CP(1,6)
  588. print(" ")
  589. print(" ")
  590. print(" ")
  591. print(" ")
  592. print(" ")
  593. print(" ")
  594. print(" ")
  595. print(" ")
  596. print(" ")
  597. print(" ")
  598. print(" ")
  599. print(" ")
  600.  
  601. BC(256)
  602. TC(1)
  603. CP(3,6)
  604. print(" Account 3 ")
  605.  
  606. w, h = term.getSize()
  607. h = (h-1)
  608. BC(128)
  609. TC(1)
  610. CP(3,h)
  611. print("Desktop")
  612.  
  613. BC(128)
  614. TC(1)
  615. CP(4,9)
  616. write("Edit name")
  617. TC(256)
  618. print(" - "..u3)
  619.  
  620. BC(128)
  621. TC(1)
  622. CP(4,11)
  623. write("Edit password")
  624. TC(256)
  625. print(" - ******")
  626.  
  627. if ACTF3 == "true" then
  628. CP(15,6)
  629. if Recht == "Admin" then
  630. BC(2048)
  631. write(" ")
  632. BC(32768)
  633. print(" ")
  634. else
  635. BC(16384)
  636. write(" ")
  637. BC(32768)
  638. print(" ")
  639. end
  640. else
  641. CP(15,6)
  642. if Recht == "Admin" then
  643. BC(32768)
  644. write(" ")
  645. BC(256)
  646. print(" ")
  647. else
  648. BC(32768)
  649. write(" ")
  650. BC(16384)
  651. print(" ")
  652. end
  653. end
  654.  
  655. while true do
  656. event,side,x,y = os.pullEvent()
  657. if event == "mouse_click" then
  658.  
  659. if x >= 15 and x <= 17 and y == 6 then
  660. if Recht == "Admin" then
  661. if ACTF3 == "true" then
  662. ACTF3 = "false"
  663. else
  664. ACTF3 = "true"
  665. end
  666.  
  667. local file = fs.open("SimSoft/Daten/User/User3","w")
  668. file.close()
  669. local file = fs.open("SimSoft/Daten/User/User3","w")
  670. file.writeLine(u3)
  671. file.writeLine(p3)
  672. file.writeLine(ACTF3)
  673. file.close()
  674. end
  675. end
  676.  
  677. if x >= 3 and x <= 9 and y == h then
  678. backD = true
  679. break
  680. end
  681.  
  682. if x >= 4 and x <= 12 and y == 9 then
  683.  
  684. if Recht == "Admin" or RechtH == 3 then
  685. BC(128)
  686. CP(16,9)
  687. TC(256)
  688. print(" ")
  689. CP(16,9)
  690. nname = read()
  691.  
  692. local file = fs.open("SimSoft/Daten/User/User3","w")
  693. file.close()
  694. local file = fs.open("SimSoft/Daten/User/User3","w")
  695. file.writeLine(nname)
  696. file.writeLine(p3)
  697. file.writeLine(ACTF3)
  698. file.close()
  699. CP(16,9)
  700. TC(32)
  701. print("Saved! ")
  702. sleep(0.2)
  703. break
  704. else
  705. CP(16,9)
  706. BC(128)
  707. TC(16384)
  708. print("You are not a user 3 ")
  709. sleep(1)
  710. break
  711. end
  712. end
  713.  
  714. if x >= 4 and x <= 16 and y == 11 then
  715.  
  716. if Recht == "Admin" or RechtH == 3 then
  717. BC(128)
  718. CP(20,11)
  719. TC(256)
  720. print(" ")
  721. CP(20,11)
  722. npass = read("*")
  723.  
  724. local file = fs.open("SimSoft/Daten/User/User3","w")
  725. file.close()
  726. local file = fs.open("SimSoft/Daten/User/User3","w")
  727. file.writeLine(u3)
  728. file.writeLine(npass)
  729. file.writeLine(ACTF3)
  730. file.close()
  731. CP(20,11)
  732. TC(32)
  733. print("Saved! ")
  734. sleep(0.2)
  735. break
  736. else
  737. CP(20,11)
  738. BC(128)
  739. TC(16384)
  740. print("You are not a user 3 ")
  741. sleep(1)
  742. break
  743. end
  744. end
  745.  
  746.  
  747. if x >= 3 and x <= 13 and y == 6 then
  748. TC(1)
  749. CP(3,6)
  750. BC(256)
  751. print(" Choose an account ")
  752. TC(256)
  753. BC(1)
  754. CP(3,7)
  755. print(" ")
  756. TC(1)
  757. BC(256)
  758. CP(3,8)
  759. print(" Account 1 - Adm. ")
  760. TC(256)
  761. BC(1)
  762. CP(3,9)
  763. print(" Account 2 ")
  764. TC(1)
  765. BC(256)
  766. CP(3,10)
  767. print(" Account 3 ")
  768.  
  769. while true do
  770. event,side,x,y = os.pullEvent()
  771. if event == "mouse_click" then
  772.  
  773. if x >= 3 and x <= 21 and y == 8 then
  774. AC = 1
  775. break
  776. elseif x >= 3 and x <= 21 and y == 9 then
  777. AC = 2
  778. break
  779. elseif x >= 3 and x <= 21 and y == 10 then
  780. AC = 3
  781. break
  782. elseif x >= 3 and x <= 21 and y >= 11 and y <= 19 or x >= 1 and x <= 51 and y >= 1 and y <= 5 or x >= 1 and x <= 2 and y >= 1 and y <= 19 or x >= 22 and x <= 51 and y >= 1 and y <= 19 then
  783. AC = 3
  784. break
  785. end
  786. end
  787. end
  788. end
  789. break
  790. end
  791. end
  792. end
  793. if backD == true then
  794. break
  795. end
  796. end
Add Comment
Please, Sign In to add comment