Difference between revisions of "Redstone.getInput"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=redstone.getInput |args=string side |returns=boolean state of redstone signal |api=redstone |examples= {{Example |desc=Checks if the com...")
 
m (Corrected mapping from "Boolean" to "Boolean (type)")
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
|name=redstone.getInput
 
|name=redstone.getInput
 
|args=[[string]] side
 
|args=[[string]] side
|returns=[[boolean]] state of redstone signal
+
|returns=[[boolean_(type)|boolean]] state of redstone signal
 
|api=redstone
 
|api=redstone
 
|examples=
 
|examples=
 
{{Example
 
{{Example
 
|desc=Checks if the computer is receiving a redstone signal
 
|desc=Checks if the computer is receiving a redstone signal
|code=print(redstone.getInput("back"))
+
|code=[[print]] (redstone.getInput("back"))
 
|output=true if the computer is getting redstone power from the back; otherwise false
 
|output=true if the computer is getting redstone power from the back; otherwise false
 
}}
 
}}
Line 14: Line 14:
 
* This function will throw an error if you give it an invalid side.
 
* This function will throw an error if you give it an invalid side.
 
}}
 
}}
 +
 +
[[Category:Lua_Core_Functions]]

Latest revision as of 13:42, 30 November 2012


Grid Redstone.png  Function redstone.getInput
No description provided.
Syntax redstone.getInput(string side)
Returns boolean state of redstone signal
Part of ComputerCraft
API redstone

Examples

Grid paper.png  Example
Checks if the computer is receiving a redstone signal
Code
print (redstone.getInput("back"))
Output true if the computer is getting redstone power from the back; otherwise false

Additional Notes

  • This function will throw an error if you give it an invalid side.