Advertisement
Plazter

Bundled(WIP)

Aug 23rd, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. col = {
  2. [1] = 0,     -- Inactive
  3. [2] = 1,     -- White
  4. [3] = 2,     -- Orange
  5. [4] = 4,     -- Magenta
  6. [5] = 8,     -- Light Blue
  7. [6] = 16,    -- Yellow
  8. [7] = 32,    -- Lime
  9. [8] = 64,    -- Pink
  10. [9] = 128,   -- Gray
  11. [10] = 256,   -- Light Gray
  12. [11] = 512,   -- Cyan
  13. [12] = 1024,  -- Purple
  14. [13] = 2048,  -- Blue
  15. [14] = 4096,  -- Brown
  16. [15] = 8192,  -- Green
  17. [16] = 16384, -- Red
  18. [17] = 32768, -- Black
  19. }
  20.  on = {}
  21.  
  22.  function getOn()  
  23.   for i = 1,#col do  
  24.     if rs.getBundledOutput("right") == col[i] then
  25.       table.insert(on, col[i])
  26.     end
  27.   end
  28. end
  29.  
  30.  
  31. getOn()
  32. for i = 1,#on do
  33. print(on[i])
  34. end
  35.  
  36. input = read()
  37.  
  38. if input then  
  39.     if input == "white" then
  40.         if not on == col[1] then
  41.             for i = 1,#on do   
  42.                 rs.setbundledOutput("right", col[2]+on[i])
  43.             end
  44.         else
  45.             rs.setBundledOutput("right", col[2])
  46.         end
  47.     end
  48.      
  49.     if input == "green" then
  50.         if not on == col[1] then
  51.             for i = 1,#on do   
  52.                 rs.setbundledOutput("right", col[2]+on[i])
  53.             end
  54.         else
  55.             rs.setBundledOutput("right", col[15])    
  56.         end    
  57.     end
  58.      
  59.     if input == "red" then
  60.         if not on == col[1] then
  61.             for i = 1,#on do   
  62.                 rs.setbundledOutput("right", col[2]+on[i])
  63.             end
  64.         else
  65.             rs.setBundledOutput("right", col[16])  
  66.         end
  67.     end
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement