Advertisement
PolskiWisnia

.programy

Mar 6th, 2018
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. -- Oprogramowanie skladowe/instalator systemow/czesc skladowa stworzonych przez uzytkownika serwisu Discord - Wisnia#5536 --
  2. -- Jesli zaplaciles za to oprogramowanie zostales oszukany. --
  3. -- Zakazuje sie kopiowania oprogramowania bez zgody autora, czerpania korzysci materialnych, podpisywania sie pod oprogramowaniem --
  4. -- Dozwolone jest tworzenie modyfikacji oprogramowania badz jego czesci wylacznie wtedy, gdy widoczna jest informacja o oryginalnym autorze --
  5. -- Kompletna EULA dostepna jest na serwerze Discord: CRfXMXU --
  6. while true do
  7. os.pullEvent = os.pullEventRaw
  8. local w,h = term.getSize()
  9.  
  10. function printCentered( y,s )
  11. local x = math.floor((w - string.len(s)) / 2)
  12. term.setCursorPos(x,y)
  13. term.clearLine()
  14. term.write( s )
  15. end
  16.  
  17. local nOption = 1
  18.  
  19. local function drawMenu()
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. term.write("Wsparcie dla Minedows 2.0 zostalo ")
  23.  
  24.  
  25. term.setCursorPos(w-11,1)
  26. if nOption == 1 then
  27. term.write("zakonczone")
  28. elseif nOption == 2 then
  29. term.write("Labirynt")
  30. elseif nOption == 3 then
  31. term.write("O i X ")
  32. elseif nOption == 4 then
  33. term.write("Ochroniarz")
  34. elseif nOption == 5 then
  35. term.write("GraoZyciu")
  36. elseif nOption == 6 then
  37. term.write("NaprawOS ")
  38. elseif nOption == 7 then
  39. term.write("Powrot do OS")
  40. else
  41. end
  42.  
  43. end
  44.  
  45. --GUI
  46. local function drawFrontend()
  47. printCentered( math.floor(h/2) - 3, "")
  48. printCentered( math.floor(h/2) - 2, "MinedowsMenu v1.0" )
  49. printCentered( math.floor(h/2) - 1, "")
  50. printCentered( math.floor(h/2) + 0, ((nOption == 1) and "[ Paint ]") or "Paint" )
  51. printCentered( math.floor(h/2) + 1, ((nOption == 2) and "[Labirynt ]") or "Labirynt" )
  52. printCentered( math.floor(h/2) + 2, ((nOption == 3) and "[O i X ]") or "O i X" )
  53. printCentered( math.floor(h/2) + 4, ((nOption == 4) and "[Ochroniarz]") or "Ochroniarz" )
  54. printCentered( math.floor(h/2) + 5, ((nOption == 5) and "[GraOZyciu ]") or "GraOZyciu" )
  55. printCentered( math.floor(h/2) + 6, ((nOption == 6) and "[NaprawOS ]") or "NaprawOS " )
  56. printCentered( math.floor(h/2) + 7, ((nOption == 7) and "[Powrot ]") or "Powrot " )
  57. end
  58.  
  59. --Display
  60. drawMenu()
  61. drawFrontend()
  62.  
  63. while true do
  64. local e,p = os.pullEvent()
  65. if e == "key" then
  66. local key = p
  67. if key == 17 or key == 200 then
  68.  
  69. if nOption > 1 then
  70. nOption = nOption - 1
  71. drawMenu()
  72. drawFrontend()
  73. end
  74. elseif key == 31 or key == 208 then
  75. if nOption < 7 then
  76. nOption = nOption + 1
  77. drawMenu()
  78. drawFrontend()
  79. end
  80. elseif key == 28 then
  81.  
  82. break
  83. end
  84. end
  85. end
  86. term.clear()
  87.  
  88. --Conditions
  89. if nOption == 1 then
  90. shell.run("os/.paint 1")
  91. elseif nOption == 2 then
  92. shell.run("os/gry/.waz")
  93. elseif nOption == 3 then
  94. shell.run("os/gry/.kolkokrzyzyk")
  95. elseif nOption == 4 then
  96. shell.run("os/gry/.ochroniarz")
  97. elseif nOption == 5 then
  98. shell.run("os/gry/.graozyciu")
  99. elseif nOption == 6 then
  100. shell.run(".naprawa")
  101. elseif nOption == 7 then
  102. shell.run("os/.menu")
  103. end
  104. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement