Advertisement
oGoOgO

repar tab

May 10th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1.  
  2. local term = require('term')
  3. local com = require('component')
  4. local sensor = com.radar
  5. local gpu = com.gpu
  6. floor = math.floor
  7.  
  8.  
  9. color = {
  10.     green = 0x00ff00,
  11.     yellow = 0xffb600,
  12.     red = 0xff0000
  13. }
  14.  
  15. -- Белый список ---
  16. white = {
  17.     Alex = true,
  18.     NEO = true,
  19.     Elena23 = true,
  20.     AdskiyGrifer12 = false
  21. }
  22.  
  23.  
  24. gpu.setResolution(35,15)
  25.  
  26. while true do
  27.     pl = sensor.getPlayers()
  28.     term.clear()
  29.     gpu.setForeground(color.yellow)
  30.     gpu.set(2,1, 'В зоне обнаружения радара: '..#pl..' чел.')
  31.         for i = 1, #pl do
  32.             if white[pl[i].name] then gpu.setForeground(color.green)
  33.             else gpu.setForeground(color.red) end
  34.             gpu.set(2, i+1, i..'. '..pl[i].name)
  35.             gpu.set(25, i+1, ' - '..floor(pl[i].distance)..' м')
  36.         end
  37.     os.sleep(30)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement