Difference between revisions of "Redstone.setBundledOutput"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=redstone.setBundledOutput |args=string side, int colors |api=redstone |returns=? |addon=ComputerCraft |examples= {{Example |desc=Toggles...")
 
Line 10: Line 10:
 
|desc=Toggles between the black and white wires every two seconds
 
|desc=Toggles between the black and white wires every two seconds
 
|code=while(true) do<br />    redstone.setBundledOutput("back", colors.black)<br />    sleep(2)<br />    redstone.setBundledOutput("back", colors.white)<br />    sleep(2)<br />end
 
|code=while(true) do<br />    redstone.setBundledOutput("back", colors.black)<br />    sleep(2)<br />    redstone.setBundledOutput("back", colors.white)<br />    sleep(2)<br />end
 +
|output=(nothing on the screen)
 +
}}
 +
The value is passed as an integer, so sending multiple colors is as easy as adding them together:
 +
{{Example
 +
|desc=Toggles between the black/white and red/blue wires every two seconds
 +
|code=while(true) do<br />    redstone.setBundledOutput("back", colors.black+colors.white)<br />    sleep(2)<br />    redstone.setBundledOutput("back", colors.red+colors.blue)<br />    sleep(2)<br />end
 
|output=(nothing on the screen)
 
|output=(nothing on the screen)
 
}}
 
}}
 
}}
 
}}

Revision as of 18:39, 13 April 2012


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

Examples

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)



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)