Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local term = require('term')
- local com = require('component')
- local sensor = com.radar
- local gpu = com.gpu
- floor = math.floor
- color = {
- green = 0x00ff00,
- yellow = 0xffb600,
- red = 0xff0000
- }
- -- Белый список ---
- white = {
- Alex = true,
- NEO = true,
- Elena23 = true,
- AdskiyGrifer12 = false
- }
- gpu.setResolution(35,15)
- while true do
- pl = sensor.getPlayers()
- term.clear()
- gpu.setForeground(color.yellow)
- gpu.set(2,1, 'В зоне обнаружения радара: '..#pl..' чел.')
- for i = 1, #pl do
- if white[pl[i].name] then gpu.setForeground(color.green)
- else gpu.setForeground(color.red) end
- gpu.set(2, i+1, i..'. '..pl[i].name)
- gpu.set(25, i+1, ' - '..floor(pl[i].distance)..' м')
- end
- os.sleep(30)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement