Advertisement
LBPHacker

Color toggling API for Tassyr

Mar 26th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local outputColor, outputSide
  2. local inited = false
  3.  
  4. local init = function(side, color)
  5.     -- color here is the original color value (eg. white + red + black =
  6.     -- colors.white + colors.red + colors.black = 1 + 16384 + 32768 = 49153)
  7.     outputSide = side
  8.     outputColor = color
  9.     inited = true
  10. end
  11.  
  12. local toggleOutput = function(color) -- color here is the color you want to turn off or on
  13.     if (inited) then
  14.         outputColor = bit.bxor(outputColor, color)
  15.         rs.setBundledOutput(outputSide, outputColor)
  16.     end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement