Simlor_GER

SimSoft 3.1 - Desktop

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