SHARE
TWEET

Untitled

a guest Dec 6th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     Oplot = true,
  18.  
  19. }
  20.  
  21.  
  22. gpu.setResolution(35,15)
  23.  
  24. while true do
  25.     pl = sensor.getPlayers()
  26.     term.clear()
  27.     gpu.setForeground(color.yellow)
  28.     gpu.set(2,1, 'В зоне обнаружения радара: '..#pl..' чел.')
  29.         for i = 1, #pl do
  30.             if white[pl[i].name] then gpu.setForeground(color.green)
  31.             else gpu.setForeground(color.red) end
  32.             gpu.set(2, i+1, i..'. '..pl[i].name)
  33.             gpu.set(25, i+1, ' - '..floor(pl[i].distance)..' м')
  34.         end
  35.     os.sleep(1)
  36. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top