PolskiWisnia

Untitled

Mar 14th, 2023 (edited)
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.94 KB | None | 0 0
  1. local function s(...) return sleep(...) end
  2. local function aw(...) return write(...) end
  3. local function p(...) return print(...) end
  4. local function tw(...) return term.write(...) end
  5. local function scp(...) return term.setCursorPos(...) end
  6. local function sbc(...) return term.setBackgroundColor(...) end
  7. local function stc(...) return term.setTextColor(...) end
  8. local function tc(...) return term.clear(...) end
  9. local function tcl(...) return term.clearLine(...) end
  10. local function r(...) return shell.run(...) end
  11. local function sp(...) return textutils.slowPrint(...) end
  12. local function sw(...) return textutils.slowWrite(...) end
  13. local function fse(...) return fs.exists(...) end
  14. local function pul(...) return paintutils.loadImage(...) end
  15. local function pud(...) return paintutils.drawImage(...) end
  16. local function pfb(...) return paintutils.drawFilledBox(...) end
  17. local function su(...) return os.shutdown(...) end
  18. local function re(...) return os.reboot(...) end
  19. local function pdp(...) return paintutils.drawPixel(...) end
  20.  
  21. wersja = string.sub(os.about(), 1, string.find(os.about(), "\n"))
  22. wersja = string.sub(wersja, 1, string.find(wersja, " "))
  23.  
  24.  
  25.  
  26.  
  27. os.loadAPI("mysz")
  28. os.loadAPI("gui")
  29.  
  30. function draw()
  31.     tc()
  32.     pfb(1,1,w,h,colors.cyan)
  33.     pfb(1,h,6,h,colors.black)
  34.     pfb(7,h,w,h,colors.blue)
  35.     pfb(1,1,w,1,colors.black)
  36.     scp(1,h)
  37.     stc(colors.white)
  38.     sbc(colors.black)
  39.     write("Start")
  40.     pdp(w-1, h, colors.orange)
  41.     pdp(w, h, colors.red)
  42. end
  43.  
  44.  
  45. function sys()
  46.     arg = {x, y, button}
  47.     arg = mysz.mysz()
  48.     if (arg[1]>0 and arg[1]<7 and arg[2] == h) then
  49.         select()
  50.     end
  51. end
  52.  
  53. function
  54.  
  55. function select()
  56.     gui.start()
  57.     scp(1,h-8)
  58.     sbc(colors.white)
  59.     stc(colors.black)
  60.     p[[
  61. Powrot do CraftOS
  62. Ustawienia
  63. abxy
  64. macierz kwadratowa
  65. ]]
  66.     arg = mysz.mysz()
  67.     if (arg[1]>0 and arg[1]<21 and arg[2] == h-8) then
  68.         error("...")
  69.     end
  70. end
  71.  
  72. while true do
  73. w, h = term.getSize()
  74. draw()
  75. sys()
  76. end
  77.    
Advertisement
Add Comment
Please, Sign In to add comment