Stawlie0

Untitled

Oct 10th, 2023
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.60 KB | None | 0 0
  1. require("package").loaded["doublebuffer"] = nil
  2. require("package").loaded["control"] = nil
  3.  
  4. local controlLib = require("control")
  5. local charSpace = ' '
  6.  
  7. local component = require("component")
  8. local unicode = require("unicode")
  9. local gpu = component.gpu
  10.  
  11. local ReactorlabelIDs = {}
  12.  
  13. for i = 1, 10 do
  14.     local id = controlLib.createLabel({
  15.         x = 3,
  16.         y = i,
  17.         text = "Label " .. i,
  18.     })
  19.     table.insert(ReactorlabelIDs, id)
  20. end
  21.  
  22. -- Получение разрешения экрана
  23. local width, height = gpu.getResolution()
  24.  
  25. -- Создайте угловые элементы
  26. controlLib.createLabel({x = 1, y = 1, text = "╭"})
  27. controlLib.createLabel({x = width, y = 1, text = "╮"})
  28. controlLib.createLabel({x = 1, y = height, text = "╰"})
  29. controlLib.createLabel({x = width, y = height, text = "╯"})
  30.  
  31. -- Создайте горизонтальные линии
  32. controlLib.createLabel({x = 2, y = 1, text = string.rep("⎯", width - 2)})
  33. controlLib.createLabel({x = 2, y = height, text = string.rep("⎯", width - 2)})
  34.  
  35. -- Создайте вертикальные линии
  36. for i = 2, height - 1 do
  37.     controlLib.createLabel({x = 1, y = i, text = "|"})
  38.     controlLib.createLabel({x = width, y = i, text = "|"})
  39. end
  40.  
  41. local nameTable = "Мониторинг реакторов"
  42. controlLib.createLabel({x = math.floor((width/2)-unicode.len(nameTable)/2), y = 1, text = nameTable})
  43.  
  44. controlLib.createLabel({x = 10, y = 10, text = "width = " .. width .. " height = " .. height})
  45.  
  46. -- Отрисовка всех элементов
  47. controlLib.drawAll()
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
Advertisement
Add Comment
Please, Sign In to add comment