Difference between revisions of "Redstone.getOutput"

From ComputerCraft Wiki
Jump to: navigation, search
m (Added lowercase template; should be properly formatted with the function template)
m (Named the return value)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
Redstone.getOutput(side) returns whatever you had set with Redstone.setOutput(side, out).  
+
{{Function
== Example ==
+
|name=redstone.getOutput
redstone.setOutput("left", true) -- Set the output on the left to true
+
|args={{type|string}} side
 +
|returns={{type|boolean}} state
 +
|api=redstone
 +
|desc=Returns what was set with [[redstone.setOutput]]().
 +
|examples=
 +
{{Example
 +
|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
 +
print(redstone.getOutput("left")) --Print the output
 +
}}
 +
}}
  
print(redstone.getOutput("left")) -Print the output
+
[[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