Advertisement
mrWhiskasss

аддон

Jan 28th, 2024 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --pastebin run gPzSqvJL
  2. --https://i.imgur.com/wIVT0wn.png
  3. --https://pastebin.com/LaJHZAns
  4. --update 01.10.21
  5.  
  6. local admins = {
  7. {"max32","макс"},
  8. {"OSSO","OSSO"},
  9. {"Garou","Garou"},
  10. {"__HAPKOMAH__","нарик"},
  11. {"LiwMorgan","ливМорган"},
  12. {"Alpaka_Masha","альпака"}
  13.  
  14. }
  15.  
  16. local c, fs = require("component"), require("filesystem")
  17. local gpu = c.gpu
  18. local TC, RO, RN, RD, TPS = 1, 0, 0, 0
  19.  
  20. gpu.setForeground(0x99b2f2)
  21. gpu.set(1, 2, "TPS Сервера:")
  22. local function time()
  23. local f = io.open("/tmp/TF", "w")
  24. f:write("test")
  25. f:close()
  26. return(fs.lastModified("/tmp/TF"))
  27. end
  28. local x_resol = 35
  29. local y_resol = 17
  30.  
  31. local component = require("component")
  32. local computer = require("computer")
  33. local unicode = require("unicode")
  34. local event = require("event")
  35. local gpu = component.gpu
  36. local w,h = gpu.getViewport()
  37.  
  38. local function check()
  39. gpu.fill(1,1,x_resol,y_resol," ")
  40.  
  41.  
  42. local line = 1
  43. for ind = 1,#admins do
  44. local name = admins[ind][1]
  45. local rank = admins[ind][2]
  46. gpu.setForeground(0xFFFFFF)
  47. gpu.set(1,line,"[")
  48. gpu.set(unicode.len(rank)+2,line,"] - "..name)
  49. if rank == "Admin" then
  50. gpu.setForeground(0xFF0000)
  51. elseif rank == "Moder" then
  52. gpu.setForeground(0x0000FF)
  53. elseif rank == "Helper" then
  54. gpu.setForeground(0xFFFF00)
  55. end
  56. gpu.set(2,line,rank)
  57. if computer.addUser(name) then
  58. computer.removeUser(name)
  59. gpu.setForeground(0x00FF00)
  60. gpu.set(x_resol-7,line,"online")
  61. else
  62. gpu.setForeground(0x999999)
  63. gpu.set(x_resol-7,line,"offline")
  64. end
  65. line = line + 1
  66. end
  67. RO = time()
  68. os.sleep(TC)
  69. RN = time()
  70. RD = RN - RO
  71. TPS = 20000 * TC / RD
  72. TPS = string.sub(TPS, 1, 5)
  73. nTPS = tonumber(TPS)
  74. gpu.set(13, 17, " ")
  75. if nTPS <= 10 then
  76. gpu.setForeground(0xcc4c4c)
  77. elseif nTPS <= 15 then
  78. gpu.setForeground(0xf2b233)
  79. elseif nTPS > 15 then
  80. gpu.setForeground(0x7fcc19)
  81. end
  82. gpu.set(13, 17, "тпс = "..TPS)
  83. end
  84.  
  85. os.execute("cls")
  86. print("Коснитесь экрана")
  87. computer.addUser(({event.pull("touch")})[6])
  88. gpu.setResolution(x_resol,y_resol)
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. while true do
  97. check()
  98. local e = ({event.pull(5,"key_down")})[4]
  99. if e == 29 or e == 157 then -- Ctrl Выход
  100. gpu.setResolution(w,h)
  101. gpu.setBackground(0x000000)
  102. gpu.setForeground(0xFFFFFF)
  103. os.execute("cls")
  104. os.exit()
  105. end
  106.  
  107. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement