Difference between revisions of "Redstone (API)"
From ComputerCraft Wiki
(Changed it so that it is consistent with some of the other pages. To help people not get confused as I did.) |
|||
Line 14: | Line 14: | ||
!style="background:#EEE" width="*"|Description | !style="background:#EEE" width="*"|Description | ||
|- | |- | ||
− | |[[redstone.getSides|getSides]]() | + | |[[redstone.getSides|rs.getSides]]() |
|Returns an array of possible sides | |Returns an array of possible sides | ||
|- | |- | ||
− | |[[redstone.getInput|getInput]]([[string (type)|string]] side) | + | |[[redstone.getInput|rs.getInput]]([[string (type)|string]] side) |
|Returns the current redstone input signal state on ''side'' | |Returns the current redstone input signal state on ''side'' | ||
|- | |- | ||
− | |[[redstone.setOutput|setOutput]]([[string (type)|string]] side, [[boolean]] value) | + | |[[redstone.setOutput|rs.setOutput]]([[string (type)|string]] side, [[boolean]] value) |
|Set or reset a redstone signal on ''side'' | |Set or reset a redstone signal on ''side'' | ||
|- | |- | ||
− | |[[redstone.getOutput|getOutput]]([[string (type)|string]] side) | + | |[[redstone.getOutput|rs.getOutput]]([[string (type)|string]] side) |
|Returns the current redstone output signal on ''side'' | |Returns the current redstone output signal on ''side'' | ||
|- | |- | ||
− | |[[redstone.getBundledInput|getBundledInput]]([[string (type)|string]] side) | + | |[[redstone.getBundledInput|rs.getBundledInput]]([[string (type)|string]] side) |
|Returns the state of a redpower wire inside a bundle connected to ''side'' | |Returns the state of a redpower wire inside a bundle connected to ''side'' | ||
|- | |- | ||
− | |[[redstone.getBundledOutput|getBundledOutput]]([[string (type)|string]] side) | + | |[[redstone.getBundledOutput|rs.getBundledOutput]]([[string (type)|string]] side) |
|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|setBundledOutput]]([[string (type)|string]] side, [[int]] colors) | + | |[[redstone.setBundledOutput|rs.setBundledOutput]]([[string (type)|string]] side, [[int]] colors) |
|Sets one or multiple colored signals in a redpower bundled wire connected to ''Side'' | |Sets one or multiple colored signals in a redpower bundled wire connected to ''Side'' | ||
|- | |- | ||
− | |[[redstone.testBundledInput|testBundledInput]]([[string (type)|string]] side, [[int]] color) | + | |[[redstone.testBundledInput|rs.testBundledInput]]([[string (type)|string]] side, [[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 10:36, 29 May 2012
Description
The redstone API contains methods to control attached RedPower cables/bundled cables
Note: Currently the redstone API has issues in SMP in some circumstances where the Minecraft server is running Linux. This appears to occur when the RedPower mod loads after ComputerCraft on the server. It is currently confirmed to occur on Ubuntu 11.10 but may occur on other systems as well.
- TO Authors: This CAN be fixed, using BaseMod.getPriorities(). It allows you to specify that ComputerCraft must be loaded before/after RedPower; see the ModLoader javadoc for details.
Methods
Method name | Description |
---|---|
rs.getSides() | Returns an array of possible sides |
rs.getInput(string side) | Returns the current redstone input signal state on side |
rs.setOutput(string side, boolean value) | Set or reset a redstone signal on side |
rs.getOutput(string side) | Returns the current redstone output signal on side |
rs.getBundledInput(string side) | Returns the state of a redpower wire inside a bundle connected to side |
rs.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) |
rs.setBundledOutput(string side, int colors) | Sets one or multiple colored signals in a redpower bundled wire connected to Side |
rs.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 |