Difference between revisions of "Redstone.getOutput"

From ComputerCraft Wiki
Jump to: navigation, search
m (Moved to CAT:LuaCoreFunctions)
m (Named the return value)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=redstone.getOutput
 
|name=redstone.getOutput
|args=[[string]] side
+
|args={{type|string}} side
|returns=[[int (type)|int]]
+
|returns={{type|boolean}} state
 
|api=redstone
 
|api=redstone
|desc=Returns what was set with [[redstone.setOutput]].
+
|desc=Returns what was set with [[redstone.setOutput]]().
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Set the output of "left" to true, then print the output of "left".
+
|desc=Sets the output of the left side to true, then prints the output of the left side.
|code=redstone.setOutput("left", true) -- Set the output on the left to true<br />print(redstone.getOutput("left")) -Print the output
+
|code=redstone.setOutput("left", true) -- Set the output on the left to true
 +
print(redstone.getOutput("left")) --Print the output
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Latest revision as of 23:56, 5 May 2013


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

Examples

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