Advertisement
Exozze

Untitled

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