Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 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. SkyDy2 = true,
  17. Crafter2018kot = true,
  18. saba4ka666 = true,
  19. Enexdi= false,
  20. TimberLine = 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(1)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement