Difference between revisions of "Redstone.setBundledOutput"
From ComputerCraft Wiki
Smiley43210 (Talk | contribs) m (Changed to use type template) |
m (Also make the function local) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=redstone.setBundledOutput | |name=redstone.setBundledOutput | ||
− | |args={{type|string}} side, {{type| | + | |args={{type|string}} side, {{type|number}} colors |
|api=redstone | |api=redstone | ||
− | |returns= | + | |returns=nil |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|examples= | |examples= | ||
Line 10: | Line 10: | ||
{{Example | {{Example | ||
|desc=Toggles between the black and white wires every two seconds | |desc=Toggles between the black and white wires every two seconds | ||
− | |code=while | + | |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) | |output=(nothing on the screen) | ||
}} | }} | ||
Line 17: | Line 17: | ||
{{Example | {{Example | ||
|desc=Toggles between the black/white and red/blue wires every two seconds | |desc=Toggles between the black/white and red/blue wires every two seconds | ||
− | |code=while | + | |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) | ||
}} | }} | ||
Line 23: | Line 23: | ||
{{Example | {{Example | ||
|desc=Unsets the output (removes all power) | |desc=Unsets the output (removes all power) | ||
− | |code=function unsetAll(sSide)<br /> redstone.setBundledOutput(sSide, 0)<br />end | + | |code=local function unsetAll(sSide)<br /> redstone.setBundledOutput(sSide, 0)<br />end |
|output=(nothing on the screen) | |output=(nothing on the screen) | ||
}} | }} |
Latest revision as of 07:20, 12 October 2018
Function redstone.setBundledOutput | |
No description provided. | |
Syntax | redstone.setBundledOutput(string side, number colors) |
Returns | nil |
Part of | ComputerCraft |
API | redstone |
Examples
Basic usage
Combining outputs
The value is passed as an integer, so sending multiple colors is as easy as adding them together:
Clearing the output
Example | |
Unsets the output (removes all power) | |
Code |
local function unsetAll(sSide) |
Output | (nothing on the screen) |