redstone.testBundledInput

From ComputerCraft Wiki
Revision as of 00:08, 28 June 2015 by Bomb Bloke (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Grid Redstone.png  Function redstone.testBundledInput
Checks to see whether the specified color (or combined color value) is active within a bundled cable input on a given side. Ignores whether other colors are active or not.
Syntax redstone.testBundledInput(string side, number color value)
Returns boolean true if on, false if off
Part of ComputerCraft
API redstone

Examples

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



Grid paper.png  Example
Checks whether the blue and lime parts of the back input are both active.
Code
print(redstone.testBundledInput ("back", colors.combine(colors.blue, colors.lime)))
Output Prints "true" if they're both active, otherwise prints "false".