Difference between revisions of "Redstone.getBundledInput"

From ComputerCraft Wiki
Jump to: navigation, search
m (Correcting link for number)
 
(7 intermediate revisions by 4 users not shown)
Line 4: Line 4:
 
|args=[[string]] side
 
|args=[[string]] side
 
|api=redstone
 
|api=redstone
|returns=[[colors (type)|colors]] the colours that are activated on that side
+
|returns=The {{type|number}} representation of the colours (see [[Colors_(API)|Colors (API)]]) that are activated on that side
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 
|examples=
 
|examples=
 
{{Example
 
{{Example
 
|desc=Checks whether the blue part of the back input is active
 
|desc=Checks whether the blue part of the back input is active
|code=print(colors.test(redstone.getBundledInput("back"), colors.blue))
+
|code=[[print]] ([[colors.test]] (redstone.getBundledInput("back"), colors.blue))
 
|output=true if the blue part of the back input is active, otherwise false
 
|output=true if the blue part of the back input is active, otherwise false
}}
 
{{Example 2
 
|desc=Checks wich color (int) is activated
 
|code=print(redstone.getBundledInput("back"))
 
|output=the number (1-16) which cable is activated
 
 
}}
 
}}
 
}}
 
}}
 +
 +
[[Category:Lua_Core_Functions]]

Latest revision as of 10:59, 18 July 2013


Grid Redstone.png  Function redstone.getBundledInput
No description provided.
Syntax redstone.getBundledInput(string side)
Returns The number representation of the colours (see Colors (API)) that are activated on that side
Part of ComputerCraft
API redstone

Examples

Grid paper.png  Example
Checks whether the blue part of the back input is active
Code
print (colors.test (redstone.getBundledInput("back"), colors.blue))
Output true if the blue part of the back input is active, otherwise false