SHOW:
|
|
- or go back to the newest paste.
1 | - | ---by serafim |
1 | + | ---by serafim |
2 | - | |
2 | + | |
3 | - | local admins = { |
3 | + | local admins = { |
4 | - | {"Alex25764","Owner"}, |
4 | + | {"Alex25764","Owner"}, |
5 | - | {"Aboba1337","Daniil"}, |
5 | + | {"Aboba1337","Daniil"}, |
6 | - | {"sad_volodia","Sebek"}, |
6 | + | {"sad_volodia","Sebek"}, |
7 | - | {"jesia_","Bebek"}, |
7 | + | {"jesia_","Bebek"}, |
8 | - | {"Painfulspirit","Member"}, |
8 | + | {"Painfulspirit","Member"}, |
9 | - | {"p1nango","afk"}, |
9 | + | {"p1nango","afk"}, |
10 | - | {"superlg2","afk"}, |
10 | + | {"superlg2","afk"}, |
11 | - | {"Cuudec","afk"}, |
11 | + | {"Cuudec","afk"}, |
12 | - | {"maksimgeims","afk"}, |
12 | + | {"maksimgeims","afk"}, |
13 | - | {"BanDaBoom","afk"}, |
13 | + | {"BanDaBoom","afk"}, |
14 | - | } |
14 | + | } |
15 | - | |
15 | + | |
16 | - | local x_resol = 35 |
16 | + | local scale = require("scale") |
17 | - | local y_resol = 16 |
17 | + | scale.set(1) |
18 | - | |
18 | + | |
19 | - | local component = require("component") |
19 | + | local component = require("component") |
20 | - | local computer = require("computer") |
20 | + | local computer = require("computer") |
21 | - | local event = require("event") |
21 | + | local event = require("event") |
22 | - | local gpu = component.gpu |
22 | + | local gpu = component.gpu |
23 | - | local w,h = gpu.getViewport() |
23 | + | local w,h = gpu.getViewport() |
24 | - | |
24 | + | |
25 | - | local function check() |
25 | + | |
26 | - | gpu.fill(1,1,x_resol,y_resol," ") |
26 | + | local function check() |
27 | - | local line = 1 |
27 | + | gpu.fill(1,1,scale," ") |
28 | - | for ind = 1,#admins do |
28 | + | local line = 1 |
29 | - | local name = admins[ind][1] |
29 | + | for ind = 1,#admins do |
30 | - | local rank = admins[ind][2] |
30 | + | local name = admins[ind][1] |
31 | - | gpu.setForeground(0xFFFFFF) |
31 | + | local rank = admins[ind][2] |
32 | - | gpu.set(1,line,"[") |
32 | + | gpu.setForeground(0xFFFFFF) |
33 | - | gpu.set(string.len(rank)+2,line,"] - "..name) |
33 | + | gpu.set(1,line,"[") |
34 | - | if rank == "Owner" then |
34 | + | gpu.set(string.len(rank)+2,line,"] - "..name) |
35 | - | gpu.setForeground(0xFF0000) |
35 | + | if rank == "Owner" then |
36 | - | elseif rank == "Member" then |
36 | + | gpu.setForeground(0xFF0000) |
37 | - | gpu.setForeground(0x00FFFF) |
37 | + | elseif rank == "Member" then |
38 | - | elseif rank == "afk" then |
38 | + | gpu.setForeground(0x00FFFF) |
39 | - | gpu.setForeground(0xC0C0C0) |
39 | + | elseif rank == "afk" then |
40 | - | elseif rank == "Daniil" then |
40 | + | gpu.setForeground(0xC0C0C0) |
41 | - | gpu.setForeground(0xAA00AA) |
41 | + | elseif rank == "Daniil" then |
42 | - | elseif rank == "Sebek" then |
42 | + | gpu.setForeground(0xAA00AA) |
43 | - | gpu.setForeground(0x00FFFF) |
43 | + | elseif rank == "Sebek" then |
44 | - | elseif rank == "Bebek" then |
44 | + | gpu.setForeground(0x00FFFF) |
45 | - | gpu.setForeground(0x00FFFF) |
45 | + | elseif rank == "Bebek" then |
46 | - | end |
46 | + | gpu.setForeground(0x00FFFF) |
47 | - | gpu.set(2,line,rank) |
47 | + | end |
48 | - | if computer.addUser(name) then |
48 | + | gpu.set(2,line,rank) |
49 | - | computer.removeUser(name) |
49 | + | if computer.addUser(name) then |
50 | - | gpu.setForeground(0x00FF00) |
50 | + | computer.removeUser(name) |
51 | - | gpu.set(x_resol-7,line,"online") |
51 | + | gpu.setForeground(0x00FF00) |
52 | - | else |
52 | + | gpu.set(x_resol-7,line,"online") |
53 | - | gpu.setForeground(0x444444) |
53 | + | else |
54 | - | gpu.set(x_resol-7,line,"offline") |
54 | + | gpu.setForeground(0x444444) |
55 | - | end |
55 | + | gpu.set(x_resol-7,line,"offline") |
56 | - | line = line + 1 |
56 | + | end |
57 | - | end |
57 | + | line = line + 1 |
58 | end | |
59 | - | |
59 | + | end |
60 | - | os.execute("cls") |
60 | + | |
61 | - | for ind = 1,#admins do |
61 | + | os.execute("cls") |
62 | - | computer.removeUser(admins[ind][1]) |
62 | + | for ind = 1,#admins do |
63 | computer.removeUser(admins[ind][1]) | |
64 | - | gpu.setResolution(x_resol,y_resol) |
64 | + | end |
65 | - | |
65 | + | gpu.setResolution(x_resol,y_resol) |
66 | - | while true do |
66 | + | |
67 | - | check() |
67 | + | while true do |
68 | - | local e = ({event.pull(5,"key_down")})[4] |
68 | + | check() |
69 | - | if e == 29 or e == 157 then -- Ctrl Выход |
69 | + | local e = ({event.pull(5,"key_down")})[4] |
70 | - | gpu.setResolution(w,h) |
70 | + | if e == 29 or e == 157 then -- Ctrl Выход |
71 | - | gpu.setBackground(0x000000) |
71 | + | scale.set(1) |
72 | - | gpu.setForeground(0xFFFFFF) |
72 | + | gpu.setBackground(0x000000) |
73 | - | os.execute("cls") |
73 | + | gpu.setForeground(0xFFFFFF) |
74 | - | os.exit() |
74 | + | os.execute("cls") |
75 | - | end |
75 | + | os.exit() |
76 | end | |
77 | end |