User:Oddstr13/Sandbox/Example test

From ComputerCraft Wiki
Jump to: navigation, search


Grid paper.png  Example
Enable a single color, disable all others.
Code
redstone.setBundledOutput("back", colors.red)
Output Red



Grid paper.png  Example
Enable two colors, disable all others.
Code
redstone.setBundledOutput("back", colors.combine(colors.red, colors.green))
Output Red, Green



   redstone.setBundledOutput(sSide,colors.combine(redstone.getBundledOutput(sSide),colors.brown)) 
   -- ^ combine last input with new input, in this case white is mixed with brown, making those two colors enabled.
   sleep(2)
   redstone.setBundledOutput(sSide, 0)  -- disable all output
   sleep(2)
   redstone.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide), colors.black)) 
   -- ^ disable the black wire but keep all other wires enabled, in this case it disables the black wire but keeps the white wire enabled from the last command.

If you still need help with the bundledcables, i suggest asking on the forums or going on IRC.