Difference between revisions of "Redstone.getOutput"

From ComputerCraft Wiki
Jump to: navigation, search
Line 6: Line 6:
 
|api=redstone
 
|api=redstone
 
|desc=Returns what was set with [[redstone.setOutput]].
 
|desc=Returns what was set with [[redstone.setOutput]].
 +
|examples=
 +
{{Example
 +
|desc=Set the output of "left" to true, then print the output of "left".
 +
|code=redstone.setOutput("left", true) -- Set the output on the left to true<br />print(redstone.getOutput("left")) -Print the output
 +
}}
 
}}
 
}}

Revision as of 08:08, 30 May 2012


Grid Redstone.png  Function redstone.getOutput
Returns what was set with redstone.setOutput.
Syntax redstone.getOutput(string side)
Returns int
Part of ComputerCraft
API redstone

Examples

Grid paper.png  Example
Set the output of "left" to true, then print the output of "left".
Code
redstone.setOutput("left", true) -- Set the output on the left to true
print(redstone.getOutput("left")) -Print the output