SHOW:
|
|
- or go back to the newest paste.
| 1 | --https://i.imgur.com/DODsH05.png | |
| 2 | --https://pastebin.com/fgVyP3LK | |
| 3 | --update 23.06.21 | |
| 4 | local users = {
| |
| 5 | {"sad_volodia","Owner"},
| |
| 6 | - | {"Creeper","Owner"},
|
| 6 | + | {"jesia_","member"},
|
| 7 | - | {"Zombi","Member"},
|
| 7 | + | {"Aboba1337","member"},
|
| 8 | - | {"Skeleton","Member"},
|
| 8 | + | {"rolez","member"},
|
| 9 | - | {"Ghast","Member"},
|
| 9 | + | {"Alex25764","member"},
|
| 10 | - | {"Blaze","Member"},
|
| 10 | + | |
| 11 | - | {"Witch","Member"}
|
| 11 | + | |
| 12 | local x_resol = 35 | |
| 13 | local y_resol = 16 | |
| 14 | ||
| 15 | local component = require("component")
| |
| 16 | local computer = require("computer")
| |
| 17 | local event = require("event")
| |
| 18 | local gpu = component.gpu | |
| 19 | local w,h = gpu.getViewport() | |
| 20 | ||
| 21 | local function check() | |
| 22 | gpu.fill(1,1,x_resol,y_resol," ") | |
| 23 | local line = 1 | |
| 24 | for ind = 1,#users do | |
| 25 | local name = users[ind][1] | |
| 26 | local rank = users[ind][2] | |
| 27 | gpu.setForeground(0xFFFFFF) | |
| 28 | gpu.set(1,line,"[") | |
| 29 | gpu.set(string.len(rank)+2,line,"] - "..name) | |
| 30 | if rank == "Owner" then | |
| 31 | gpu.setForeground(0xFF0000) | |
| 32 | - | if rank == "Owner" then |
| 32 | + | elseif rank == "member" then |
| 33 | gpu.setForeground(0x00FFFF) | |
| 34 | - | elseif rank == "Member" then |
| 34 | + | elseif rank == "afk" then |
| 35 | - | gpu.setForeground(0x0000FF) |
| 35 | + | gpu.setForeground(0xC0C0C0) |
| 36 | elseif rank == "Sebek" then | |
| 37 | gpu.setForeground(0x00FFFF) | |
| 38 | elseif rank == "Bebek" then | |
| 39 | gpu.setForeground(0x00FFFF) | |
| 40 | end | |
| 41 | gpu.set(2,line,rank) | |
| 42 | if computer.addUser(name) then | |
| 43 | computer.removeUser(name) | |
| 44 | gpu.setForeground(0x00FF00) | |
| 45 | gpu.set(x_resol-7,line,"online") | |
| 46 | else | |
| 47 | gpu.setForeground(0x999999) | |
| 48 | gpu.set(x_resol-7,line,"offline") | |
| 49 | end | |
| 50 | line = line + 1 | |
| 51 | end | |
| 52 | end | |
| 53 | ||
| 54 | for ind = 1,#users do | |
| 55 | computer.removeUser(users[ind][1]) | |
| 56 | end | |
| 57 | os.execute("cls")
| |
| 58 | gpu.setResolution(x_resol,y_resol) | |
| 59 | ||
| 60 | while true do | |
| 61 | check() | |
| 62 | local e = ({event.pull(5,"key_down")})[4]
| |
| 63 | if e == 29 or e == 157 then -- Ctrl Выход | |
| 64 | gpu.setResolution(w,h) | |
| 65 | gpu.setBackground(0x000000) | |
| 66 | gpu.setForeground(0xFFFFFF) | |
| 67 | os.execute("cls")
| |
| 68 | os.exit() | |
| 69 | end | |
| 70 | end |