Difference between revisions of "Redstone (API)"
From ComputerCraft Wiki
m (Corrected mapping from "Boolean" to "Boolean (type)") |
m (Changed "int" to "int (type)") |
||
Line 27: | Line 27: | ||
|Returns the set of redpower wires inside a bundle on ''side'' that are being driven high <b>by the local console</b> (not those that are driven high by another device on the bundle but not driven high by the local console) | |Returns the set of redpower wires inside a bundle on ''side'' that are being driven high <b>by the local console</b> (not those that are driven high by another device on the bundle but not driven high by the local console) | ||
|- | |- | ||
− | |[[redstone.setBundledOutput]]([[string (type)|string]] side, [[int]] colors) | + | |[[redstone.setBundledOutput]]([[string (type)|string]] side, [[int (type)|int]] colors) |
|Sets one or multiple colored signals in a redpower bundled wire connected to ''Side''. In order to set multiple signals, add the color values of the colors you want to activate. To turn off all of the values, use 0 for the integer. | |Sets one or multiple colored signals in a redpower bundled wire connected to ''Side''. In order to set multiple signals, add the color values of the colors you want to activate. To turn off all of the values, use 0 for the integer. | ||
|- | |- | ||
− | |[[redstone.testBundledInput]]([[string (type)|string]] side, [[int]] color) | + | |[[redstone.testBundledInput]]([[string (type)|string]] side, [[int (type)|int]] color) |
|Returns true or false whether or not a colored signal is active in a redpower bundled wire connected to ''Side'' | |Returns true or false whether or not a colored signal is active in a redpower bundled wire connected to ''Side'' | ||
|} | |} | ||
[[Category:APIs]] | [[Category:APIs]] |
Revision as of 18:26, 30 November 2012
Description
The Redstone API contains methods to control attached RedPower cables/bundled cables and regular redstone.
Methods
Method name | Description |
---|---|
redstone.getSides() | Returns an array of possible sides |
redstone.getInput(string side) | Returns the current redstone input signal state on side |
redstone.setOutput(string side, boolean value) | Set or reset a redstone signal on side |
redstone.getOutput(string side) | Returns the current redstone output signal on side |
redstone.getBundledInput(string side) | Returns the state of a redpower wire inside a bundle connected to side |
redstone.getBundledOutput(string side) | Returns the set of redpower wires inside a bundle on side that are being driven high by the local console (not those that are driven high by another device on the bundle but not driven high by the local console) |
redstone.setBundledOutput(string side, int colors) | Sets one or multiple colored signals in a redpower bundled wire connected to Side. In order to set multiple signals, add the color values of the colors you want to activate. To turn off all of the values, use 0 for the integer. |
redstone.testBundledInput(string side, int color) | Returns true or false whether or not a colored signal is active in a redpower bundled wire connected to Side |