redstone.setBundledOutput

From ComputerCraft Wiki
Revision as of 00:11, 6 May 2013 by Smiley43210 (Talk | contribs) (Changed to use type template)

Jump to: navigation, search


Grid Redstone.png  Function redstone.setBundledOutput
No description provided.
Syntax redstone.setBundledOutput(string side, int colors)
Returns ?
Part of ComputerCraft
API redstone

Examples

Basic usage

Grid paper.png  Example
Toggles between the black and white wires every two seconds
Code
while(true) do
redstone.setBundledOutput("back", colors.black)
sleep(2)
redstone.setBundledOutput("back", colors.white)
sleep(2)
end
Output (nothing on the screen)



Combining outputs

The value is passed as an integer, so sending multiple colors is as easy as adding them together:

Grid paper.png  Example
Toggles between the black/white and red/blue wires every two seconds
Code
while(true) do
redstone.setBundledOutput("back", colors.black+colors.white)
sleep(2)
redstone.setBundledOutput("back", colors.red+colors.blue)
sleep(2)
end
Output (nothing on the screen)



Clearing the output

Grid paper.png  Example
Unsets the output (removes all power)
Code
function unsetAll(sSide)
redstone.setBundledOutput(sSide, 0)
end
Output (nothing on the screen)