Advertisement
Simlor_GER

SimSoft 4 - SappS

Jul 6th, 2016
1,691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.83 KB | None | 0 0
  1. --Copyright Simlor (http://www.computercraft.info/forums2/index.php?/user/55655-simlor/) - Alle Rechte an diesen Programm sind Simlor vorbehalten.
  2.  
  3.  
  4. local datei = http.get("http://pastebin.com/raw/LZch2Xnt")
  5. if not datei then
  6. BC(256)
  7. Clear()
  8. TC(16384)
  9. print("Please, check you internet connection!")
  10. print("Or try it later again.")
  11. sleep(3)
  12. else
  13.  
  14. fs.delete("SimSoft/Data/StoreTemp/Temp")
  15. Download("MD0dmx9s", "SimSoft/Data/StoreTemp/Temp")
  16.  
  17. BC(256)
  18. CP(15,18)
  19. print("Loading...")
  20.  
  21. function LiveSappSDar(nr)
  22.  
  23. StoreCleaner()
  24.  
  25. file = fs.open("SimSoft/Data/StoreTemp/Temp","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. Sname = fileData[nr]
  35. nr = (nr+1)
  36. Sautor = fileData[nr]
  37. nr = (nr+1)
  38. Ssterne = fileData[nr]
  39. nr = (nr+1)
  40. PBCodeS = fileData[nr]
  41. nr = (nr-3)
  42.  
  43. CP(17,6) --17,6
  44. TC(1)
  45. print(Sname)
  46.  
  47. CP(18,8)
  48. TC(128)
  49. print("Creator = "..Sautor)
  50.  
  51. CP(18,10)
  52. TC(128)
  53. print("Stars = "..Ssterne)
  54.  
  55. CP(18,13)
  56. TC(1)
  57. write("Download ")
  58. TC(128)
  59. print("("..PBCodeS..")")
  60.  
  61. CP(14,18)
  62. TC(128)
  63. print("<")
  64.  
  65. CP(50,18)
  66. TC(128)
  67. print(">")
  68.  
  69. CP(27,18)
  70. TC(128)
  71. print(ggz.."/"..anzLS)
  72. end
  73.  
  74. auswahl = 0
  75.  
  76. BC(256)
  77. Clear()
  78.  
  79. SimSoftBalken("SimSoft 4 - Store", 17)
  80.  
  81. w, h = term.getSize()
  82.  
  83. CP(1,4)
  84. BC(8)
  85. TC(32768)
  86. print(" ")
  87. write(" Store ")
  88. TC(1)
  89. print("BETA ")
  90. print(" ")
  91. TC(8)
  92. BC(1)
  93. print(" SappS-Code ")
  94. TC(1)
  95. BC(8)
  96. print(" Live-Store ")
  97. TC(8)
  98. BC(1)
  99. print(" Add a pro. ")
  100. BC(8)
  101.  
  102. z = 9
  103.  
  104. while true do
  105. z = (z+1)
  106. CP(1,z)
  107. write(" ")
  108. if z == h then
  109.  
  110. TC(1)
  111. z = (z-1)
  112. CP(2,z)
  113. print("Back")
  114. break
  115. end
  116. end
  117.  
  118. --StoreCleaner
  119.  
  120. function StoreCleaner()
  121. BC(256)
  122. ySC = 3
  123.  
  124. while true do
  125.  
  126. ySC = (ySC+1)
  127. CP(13,ySC)
  128. write(" ")
  129.  
  130. if ySC == 19 then
  131. break
  132. end
  133. end
  134. end
  135.  
  136.  
  137. --TouchMenu
  138.  
  139. function TouchMenu()
  140.  
  141. while true do
  142. event,side,ex,ry = os.pullEvent()
  143. if event == "mouse_click" then
  144.  
  145. if ex >= 1 and ex <= 12 and ry == 7 then
  146. auswahl = 1
  147. end
  148.  
  149. if ex >= 1 and ex <= 12 and ry == 8 then
  150. auswahl = 2
  151. end
  152.  
  153. if ex >= 1 and ex <= 12 and ry == 9 then
  154. auswahl = 3
  155. end
  156.  
  157. if ex >= 2 and ex <= 5 and ry == z then
  158. auswahl = 4
  159. end
  160. end
  161. end
  162. end
  163.  
  164. --Anzeige Functionen
  165.  
  166. --Kontrolle0
  167. function AnzeigeKontrolle0()
  168. while true do
  169. if auswahl == 0 then
  170. sleep(0.1)
  171. else
  172. break
  173. end
  174. end
  175. end
  176.  
  177. --Kontrolle1
  178. function AnzeigeKontrolle1()
  179. while true do
  180. if auswahl == 1 then
  181. sleep(0.1)
  182. else
  183. break
  184. end
  185. end
  186. end
  187.  
  188. --Kontrolle2
  189. function AnzeigeKontrolle2()
  190. while true do
  191. if auswahl == 2 then
  192. sleep(0.1)
  193. else
  194. break
  195. end
  196. end
  197. end
  198.  
  199. --Kontrolle3
  200. function AnzeigeKontrolle3()
  201. while true do
  202. if auswahl == 3 then
  203. sleep(0.1)
  204. else
  205. break
  206. end
  207. end
  208. end
  209.  
  210.  
  211. --1 - SappS-Code
  212. function AnzeigeStore1()
  213.  
  214. while true do
  215.  
  216. StoreCleaner()
  217.  
  218. CP(17,6)
  219. BC(256)
  220. TC(1)
  221. print("Enter a SappS-Code")
  222.  
  223. TC(128)
  224.  
  225. CP(18,8)
  226. print("SappS-Code")
  227.  
  228. CP(15,18)
  229. print("Outdated")
  230.  
  231. while true do
  232.  
  233. event,side,x,y = os.pullEvent()
  234. if event == "mouse_click" then
  235.  
  236. if x >= 18 and x <= 27 and y == 8 then
  237. CP(18,8)
  238. write(" ")
  239. CP(18,8)
  240. TC(128)
  241. sappscode = read()
  242.  
  243. CP(18,10)
  244. shell.run("pastebin run "..sappscode)
  245. CP(1,11)
  246. BC(256)
  247. print(" ")
  248. auswahl = 4
  249. break
  250. end
  251. end
  252. end
  253. end
  254. end
  255.  
  256.  
  257. --2 - Live-Store
  258. function AnzeigeStore2()
  259.  
  260. while true do
  261. StoreCleaner()
  262.  
  263. BC(256)
  264. CP(15,18)
  265. print("Loading...")
  266.  
  267. anzLS = 0
  268.  
  269. file = fs.open("SimSoft/Data/StoreTemp/Temp","r")
  270. local fileData = {}
  271. local line = file.readLine()
  272. repeat
  273. table.insert(fileData,line)
  274. line = file.readLine()
  275. until line == nil
  276. file.close()
  277.  
  278. anzLS = fileData[1]
  279.  
  280. anzLS = (anzLS+1)
  281. anzLS = (anzLS-1)
  282.  
  283. sonderzahl = (anzLS*5-2)
  284.  
  285. nr = 3
  286. ggz = 1
  287.  
  288. if anzLS == 0 then
  289. CP(15,18)
  290. print(" ")
  291. CP(15,18)
  292. TC(16384)
  293. print("ERROR - Try later")
  294.  
  295. elseif anzLS >= 1 then
  296. nr = 3
  297. ggz = 1
  298. LiveSappSDar(nr)
  299. end
  300.  
  301. while true do
  302. event,side,tx,ty = os.pullEvent()
  303. if event == "mouse_click" then
  304.  
  305. if tx == 14 and ty == 18 then
  306. if nr >= 8 then
  307. nr = (nr-5)
  308. ggz = (ggz-1)
  309. LiveSappSDar(nr)
  310. elseif nr == 3 then
  311. nr = sonderzahl
  312. ggz = anzLS
  313. LiveSappSDar(nr)
  314. end
  315. end
  316.  
  317. if tx == 50 and ty == 18 then
  318. if nr < sonderzahl then
  319. nr = (nr+5)
  320. ggz = (ggz+1)
  321. LiveSappSDar(nr)
  322. elseif nr == sonderzahl then
  323. nr = 3
  324. ggz = 1
  325. LiveSappSDar(nr)
  326. end
  327. end
  328.  
  329. if tx >= 18 and tx <= 25 and ty == 13 then
  330. BC(256)
  331. TC(32)
  332. CP(15,14)
  333. shell.run("pastebin run "..PBCodeS)
  334. auswahl = 4
  335. break
  336. end
  337. end
  338. end
  339. end
  340. end
  341.  
  342.  
  343. --3 - Add a program
  344. function AnzeigeStore3()
  345.  
  346. StoreCleaner()
  347.  
  348. programname = ""
  349.  
  350. programpfad = ""
  351.  
  352. n = ""
  353.  
  354. p = 13.0
  355.  
  356. f = 1.0
  357.  
  358. paste = false
  359.  
  360. while true do
  361.  
  362. CP(17,6)
  363. BC(256)
  364. TC(1)
  365. print("Add your own program ")
  366.  
  367. TC(128)
  368.  
  369. CP(18,8)
  370. print("Program Name (6 characters) ")
  371.  
  372. CP(18,10)
  373. print("Program path or Pastebin-Code")
  374.  
  375.  
  376. CP(18,13)
  377. TC(128)
  378. print("<")
  379. CP(23,13)
  380. print(">")
  381.  
  382. CP(26,13)
  383. TC(1)
  384. print("Pastebin")
  385. CP(35,13)
  386. BC(32768)
  387. write(" ")
  388. BC(128)
  389. print(" ")
  390.  
  391. BC(256)
  392. CP(18,16)
  393. TC(1)
  394. print("Create ")
  395.  
  396. AppG(n,p,f)
  397.  
  398. while true do
  399.  
  400. event,side,x,y = os.pullEvent()
  401. if event == "mouse_click" then
  402.  
  403. if x >= 18 and x <= 44 and y == 8 then
  404. CP(18,8)
  405. write(" ")
  406. CP(18,8)
  407. TC(128)
  408. programname = read()
  409. end
  410.  
  411. if x >= 35 and x <= 37 and y == 13 then
  412. if paste == false then
  413. CP(35,13)
  414. BC(8)
  415. write(" ")
  416. BC(32768)
  417. print(" ")
  418. paste = true
  419. elseif paste == true then
  420. CP(35,13)
  421. BC(32768)
  422. write(" ")
  423. BC(128)
  424. print(" ")
  425. paste = false
  426. end
  427. BC(256)
  428. end
  429.  
  430. if x >= 18 and x <= 46 and y == 10 then
  431. CP(18,10)
  432. write(" ")
  433. CP(18,10)
  434. TC(128)
  435. programpfad = read()
  436. end
  437.  
  438. if x == 18 and y == 13 then
  439. if f >= 2.0 then
  440. f = (f-1)
  441. AppG(n,p,f)
  442. else
  443. f = 20.0
  444. AppG(n,p,f)
  445. end
  446. end
  447.  
  448. if x == 23 and y == 13 then
  449. if f <= 19.0 then
  450. f = (f+1)
  451. AppG(n,p,f)
  452. else
  453. f = 1.0
  454. AppG(n,p,f)
  455. end
  456. end
  457.  
  458. if x >= 18 and x <= 23 and y == 16 then
  459. if programname == "" then
  460. CP(18,16)
  461. TC(16384)
  462. print("You forget somthing! ")
  463. sleep(1)
  464. CP(18,16)
  465. TC(1)
  466. print("Create ")
  467.  
  468. elseif programpfad == "" then
  469. CP(18,16)
  470. TC(16384)
  471. print("You forget somthing! ")
  472. sleep(1)
  473. CP(18,16)
  474. TC(1)
  475. print("Create ")
  476.  
  477. else
  478. CP(18,16)
  479. TC(32)
  480. print("please wait... ")
  481.  
  482. term.setBackgroundColor(128)
  483. local file = fs.open("SimSoft/Daten/SappS/A","r")
  484. local fileData = {}
  485. local line = file.readLine()
  486. repeat
  487. table.insert(fileData,line)
  488. line = file.readLine()
  489. until line == nil
  490. file.close()
  491. anz = fileData[1]
  492.  
  493. anz = (anz+1)
  494. anz = (anz-1)
  495.  
  496. if anz >= 15.0 then
  497. CP(18,16)
  498. TC(16384)
  499. print("Too many Apps. ")
  500. sleep(1)
  501. CP(18,16)
  502. TC(1)
  503. print("Create ")
  504. else
  505. anz = (anz+1)
  506. local file = fs.open("SimSoft/Daten/SappS/A","w")
  507. file.write(anz)
  508. file.close()
  509. local file = fs.open("SimSoft/Daten/SappS/"..anz,"w")
  510. file.writeLine(programname)
  511. file.writeLine(anz)
  512. file.writeLine(f)
  513. file.writeLine("")
  514. file.writeLine("sv")
  515. file.writeLine("-")
  516. if paste == false then
  517. file.writeLine(programpfad)
  518. elseif paste == true then
  519. file.writeLine("SimSoft/SappS/Downloads/"..programpfad)
  520. Download(programpfad, "SimSoft/SappS/Downloads/"..programpfad)
  521. end
  522. file.close()
  523.  
  524. CP(18,16)
  525. TC(32)
  526. BC(256)
  527. print("Finish! ")
  528. sleep(1)
  529. auswahl = 4
  530. end
  531. end
  532. end
  533. end
  534. end
  535. end
  536. end
  537.  
  538. --Store Start
  539.  
  540.  
  541. function StoreStart()
  542.  
  543. while true do
  544. if auswahl == 0 then
  545. parallel.waitForAny(AnzeigeKontrolle0)
  546. end
  547.  
  548. if auswahl == 1 then
  549. parallel.waitForAny(AnzeigeKontrolle1, AnzeigeStore1)
  550. end
  551.  
  552. if auswahl == 2 then
  553. parallel.waitForAny(AnzeigeKontrolle2, AnzeigeStore2)
  554. end
  555.  
  556. if auswahl == 3 then
  557. parallel.waitForAny(AnzeigeKontrolle3, AnzeigeStore3)
  558. end
  559.  
  560. if auswahl == 4 then
  561. break
  562. end
  563. end
  564. end
  565.  
  566. --Start
  567.  
  568. parallel.waitForAny(TouchMenu, StoreStart)
  569.  
  570. end
  571. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement