Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --pastebin run gPzSqvJL
- --https://i.imgur.com/wIVT0wn.png
- --https://pastebin.com/LaJHZAns
- --update 01.10.21
- local admins = {
- {"max32","макс"},
- {"OSSO","OSSO"},
- {"Garou","Garou"},
- {"__HAPKOMAH__","нарик"},
- {"LiwMorgan","ливМорган"},
- {"Alpaka_Masha","альпака"}
- }
- local c, fs = require("component"), require("filesystem")
- local gpu = c.gpu
- local TC, RO, RN, RD, TPS = 1, 0, 0, 0
- gpu.setForeground(0x99b2f2)
- gpu.set(1, 2, "TPS Сервера:")
- local function time()
- local f = io.open("/tmp/TF", "w")
- f:write("test")
- f:close()
- return(fs.lastModified("/tmp/TF"))
- end
- local x_resol = 35
- local y_resol = 17
- local component = require("component")
- local computer = require("computer")
- local unicode = require("unicode")
- local event = require("event")
- local gpu = component.gpu
- local w,h = gpu.getViewport()
- local function check()
- gpu.fill(1,1,x_resol,y_resol," ")
- local line = 1
- for ind = 1,#admins do
- local name = admins[ind][1]
- local rank = admins[ind][2]
- gpu.setForeground(0xFFFFFF)
- gpu.set(1,line,"[")
- gpu.set(unicode.len(rank)+2,line,"] - "..name)
- if rank == "Admin" then
- gpu.setForeground(0xFF0000)
- elseif rank == "Moder" then
- gpu.setForeground(0x0000FF)
- elseif rank == "Helper" then
- gpu.setForeground(0xFFFF00)
- end
- gpu.set(2,line,rank)
- if computer.addUser(name) then
- computer.removeUser(name)
- gpu.setForeground(0x00FF00)
- gpu.set(x_resol-7,line,"online")
- else
- gpu.setForeground(0x999999)
- gpu.set(x_resol-7,line,"offline")
- end
- line = line + 1
- end
- RO = time()
- os.sleep(TC)
- RN = time()
- RD = RN - RO
- TPS = 20000 * TC / RD
- TPS = string.sub(TPS, 1, 5)
- nTPS = tonumber(TPS)
- gpu.set(13, 17, " ")
- if nTPS <= 10 then
- gpu.setForeground(0xcc4c4c)
- elseif nTPS <= 15 then
- gpu.setForeground(0xf2b233)
- elseif nTPS > 15 then
- gpu.setForeground(0x7fcc19)
- end
- gpu.set(13, 17, "тпс = "..TPS)
- end
- os.execute("cls")
- print("Коснитесь экрана")
- computer.addUser(({event.pull("touch")})[6])
- gpu.setResolution(x_resol,y_resol)
- while true do
- check()
- local e = ({event.pull(5,"key_down")})[4]
- if e == 29 or e == 157 then -- Ctrl Выход
- gpu.setResolution(w,h)
- gpu.setBackground(0x000000)
- gpu.setForeground(0xFFFFFF)
- os.execute("cls")
- os.exit()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement