Advertisement
demongts1998

Untitled

May 6th, 2021
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. admins = {
  2. {"demongts1998","Владелец"},
  3. {"Lorddddddddddd","Модер"},
  4. {"_green_arrow","Хелпер"}
  5. }
  6.  
  7. local x_resol = 35
  8. local y_resol = 16
  9.  
  10. local component = require("component")
  11. local computer = require("computer")
  12. local gpu = component.gpu
  13. local w,h = gpu.getViewport()
  14.  
  15. gpu.setResolution(x_resol,y_resol)
  16.  
  17. local function check()
  18. gpu.fill(1,1,x_resol,y_resol," ")
  19. local line = 1
  20. for ind = 1,#Владелец do
  21. local name = Владелец[ind][1]
  22. local rank = Владелец[ind][2]
  23. gpu.setForeground(0xFFFFFF)
  24. gpu.set(1,line,"[")
  25. gpu.set(string.len(rank)+2,line,"] - "..name)
  26. if rank == "Владелец" then
  27. gpu.setForeground(0xFF0000)
  28. elseif rank == "Модер" then
  29. gpu.setForeground(0x0000FF)
  30. elseif rank == "Хелпер" then
  31. gpu.setForeground(0xFFFF00)
  32. end
  33. gpu.set(2,line,rank)
  34. if computer.addUser(name) then
  35. computer.removeUser(name)
  36. gpu.setForeground(0x00FF00)
  37. gpu.set(x_resol-7,line,"Онлайн")
  38. else
  39. gpu.setForeground(0x999999)
  40. gpu.set(x_resol-7,line,"Не в сети")
  41. end
  42. line = line + 1
  43. end
  44. end
  45.  
  46. while true do
  47. check()
  48. local e = {require("event").pull(5,"key_down")}
  49. if e[4] == 29 or e[4] == 157 then -- Ctrl Выход
  50. gpu.setResolution(w,h)
  51. gpu.setBackground(0x000000)
  52. gpu.setForeground(0xFFFFFF)
  53. os.execute("cls")
  54. os.exit()
  55. end
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement