SHOW:
|
|
- or go back to the newest paste.
1 | - | local component = require("component") |
1 | + | local component = require("component") |
2 | - | local computer = require("computer") |
2 | + | local computer = require("computer") |
3 | - | local whitelist = {['Exozz2e'] = true} |
3 | + | local whitelist = {['Exozze'] = true} |
4 | - | local term = require("term") |
4 | + | local term = require("term") |
5 | - | local t = require("table") |
5 | + | local t = require("table") |
6 | - | local event = require("event") |
6 | + | local event = require("event") |
7 | - | local gpu = component.gpu |
7 | + | local gpu = component.gpu |
8 | - | local r = component.radar |
8 | + | local r = component.radar |
9 | - | local chat = component.chat_box |
9 | + | local chat = component.chat_box |
10 | - | local players = {} |
10 | + | local players = {} |
11 | - | chat.setName("§9ВНИМАНИЕ§7") |
11 | + | chat.setName("§9ВНИМАНИЕ§7") |
12 | - | floor = math.floor |
12 | + | floor = math.floor |
13 | - | |
13 | + | |
14 | - | gpu.setResolution(35,15) |
14 | + | gpu.setResolution(35,15) |
15 | - | |
15 | + | |
16 | - | color = { |
16 | + | color = { |
17 | - | green = 0x00ff00, |
17 | + | green = 0x00ff00, |
18 | - | yellow = 0xffb600, |
18 | + | yellow = 0xffb600, |
19 | - | red = 0xff0000 |
19 | + | red = 0xff0000 |
20 | - | } |
20 | + | } |
21 | - | function palevo() |
21 | + | function palevo() |
22 | - | local scan = r.getPlayers() |
22 | + | local scan = r.getPlayers() |
23 | - | for i = 1, #scan do |
23 | + | for i = 1, #scan do |
24 | - | if not whitelist[scan[i].name] then |
24 | + | if not whitelist[scan[i].name] then |
25 | - | t.insert(players, scan[i].name) |
25 | + | t.insert(players, scan[i].name) |
26 | - | end |
26 | + | end |
27 | end | |
28 | - | local info = t.concat(players,",") |
28 | + | local info = t.concat(players,",") |
29 | - | chat.say("§6Был замечен: §c" ..info) |
29 | + | chat.say("§6Был замечен: §c" ..info) |
30 | - | players = {} |
30 | + | players = {} |
31 | end | |
32 | - | |
32 | + | |
33 | - | while true do |
33 | + | while true do |
34 | - | local pl = r.getPlayers() |
34 | + | local pl = r.getPlayers() |
35 | - | gpu.setForeground(color.yellow) |
35 | + | term.clear() |
36 | - | gpu.set(2,1, 'В зоне обнаружения радара: '..#pl..' чел.') |
36 | + | gpu.setForeground(color.yellow) |
37 | - | for i = 1, #pl do |
37 | + | gpu.set(2,1, 'В зоне обнаружения радара: '..#pl..' чел.') |
38 | - | if whitelist[pl[i].name] then gpu.setForeground(color.green) |
38 | + | for i = 1, #pl do |
39 | - | else gpu.setForeground(color.red) end |
39 | + | if whitelist[pl[i].name] then gpu.setForeground(color.green) |
40 | - | gpu.set(2, i+1, i..'. '..pl[i].name) |
40 | + | else gpu.setForeground(color.red) end |
41 | - | gpu.set(25, i+1, ' - '..floor(pl[i].distance)..' м') |
41 | + | gpu.set(2, i+1, i..'. '..pl[i].name) |
42 | - | if r.getPlayers() then |
42 | + | gpu.set(25, i+1, ' - '..floor(pl[i].distance)..' м') |
43 | - | for j = 1, #pl do |
43 | + | if r.getPlayers() then |
44 | - | if not whitelist[pl[j].name] then |
44 | + | for j = 1, #pl do |
45 | - | palevo() |
45 | + | if not whitelist[pl[j].name] then |
46 | - | end |
46 | + | palevo() |
47 | - | end |
47 | + | end |
48 | end | |
49 | end | |
50 | - | os.sleep(30) |
50 | + | end |
51 | os.sleep(30) | |
52 | end |