local outputColor, outputSide local inited = false local init = function(side, color) -- color here is the original color value (eg. white + red + black = -- colors.white + colors.red + colors.black = 1 + 16384 + 32768 = 49153) outputSide = side outputColor = color inited = true end local toggleOutput = function(color) -- color here is the color you want to turn off or on if (inited) then outputColor = bit.bxor(outputColor, color) rs.setBundledOutput(outputSide, outputColor) end end