Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- радар Computronics by serafim
- --белый список
- local white = {
- _bongo_ = true,
- HyperGelax = true,
- Kamish32 = true,
- murphyy = true,
- pumpkin_sl = true,
- serafim = true
- }
- local com = require('component')
- local event = require("event")
- local term = require('term')
- local radar = com.isAvailable("radar") and com.radar or error("нет радара")
- local gpu = com.gpu
- local w,h = gpu.getViewport()
- gpu.setResolution(35,15)
- while true do
- local pl = radar.getPlayers()
- term.clear()
- gpu.setForeground(0xffb600)
- gpu.set(2,1, 'в зоне обнаружения радара '..#pl..' ч.')
- for i = 1, #pl do
- if white[pl[i].name] then
- gpu.setForeground(0x00ff00)
- else
- gpu.setForeground(0xff0000)
- end
- gpu.set(2, i+1, i..'. '..pl[i].name)
- gpu.set(25, i+1, ' - '..math.floor(pl[i].distance)..' м.')
- end
- 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