kamilosxd678

IlddorWorkshopHolo

Feb 14th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.88 KB | None | 0 0
  1. local component = require("component")
  2.  
  3. local gear =
  4. {
  5.    {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
  6.    {0, 0, 1, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 1, 0, 0},
  7.    {0, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2 ,2, 1, 0},
  8.    {0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0},
  9.    {0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0},
  10.    {0, 0, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 0, 0},
  11.    {1, 1, 1, 2, 2, 1, 0, 0, 0, 0, 1, 2, 2, 1, 1, 1},
  12.    {1, 2, 2, 2, 2, 1, 0, 0, 0, 0, 1, 2, 2, 2, 2, 1},
  13.    {1, 2, 2, 2, 2, 1, 0, 0, 0, 0, 1, 2, 2, 2, 2, 1},
  14.    {1, 1, 1, 2, 2, 1, 0, 0, 0, 0, 1, 2, 2, 1, 1, 1},
  15.    {0, 0, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 0, 0},
  16.    {0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0},
  17.    {0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0},
  18.    {0, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2 ,2, 1, 0},
  19.    {0, 0, 1, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 1, 0, 0},
  20.    {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}
  21. }
  22.  
  23. local moustache =
  24. {
  25.    {3, 0, 0, 3, 3, 0, 0, 3},
  26.    {3, 3, 3, 3, 3, 3, 3, 3},
  27.    {0, 3, 3, 0, 0, 3, 3, 0}
  28. }
  29.  
  30. function initHolo(holo)
  31.    holo.clear()
  32.    
  33.    holo.setPaletteColor(1, 0x808080)
  34.    holo.setPaletteColor(2, 0xD9D9D9)
  35.    holo.setPaletteColor(3, 0xFFFFFF)
  36. end
  37.  
  38. function printGear(holo, z)
  39.    for x=1,16 do
  40.       for y=1,16 do
  41.          if(not (gear[x][y] == 0)) then
  42.             holo.set(16 + x, 8 + y, z, gear[x][y])
  43.          end
  44.       end
  45.    end
  46. end
  47.  
  48. function printMoustache(holo, z)
  49.    for x=1,8 do
  50.       for y=1,3 do
  51.          if(not (moustache[y][x] == 0)) then
  52.             holo.set(20 + x, 18 + 3 - y, z, moustache[y][x])
  53.          end
  54.       end
  55.    end
  56. end
  57.  
  58. for address, primary in component.list()
  59. do
  60.     if (primary == "hologram") then
  61.         local hologram = component.proxy(address)
  62.        
  63.         initHolo(hologram)
  64.  
  65.         printGear(hologram, 23)
  66.         printGear(hologram, 24)
  67.         printMoustache(hologram, 25)
  68.     end
  69. end
Advertisement
Add Comment
Please, Sign In to add comment