redstone

Interact with redstone attached to this computer.

The redstone library exposes three "types" of redstone control:

Whenever a redstone input changes, a redstone event will be fired. This may be used instead of repeativly polling.

This module may also be referred to as rs. For example, one may call rs.getSides() instead of getSides.

Usage

getSides()Returns a table containing the six sides of the computer.
setOutput(side, on)Turn the redstone signal of a specific side on or off.
getOutput(side)Get the current redstone output of a specific side.
getInput(side)Get the current redstone input of a specific side.
setAnalogOutput(side, value)Set the redstone signal strength for a specific side.
setAnalogueOutput(side, value)Set the redstone signal strength for a specific side.
getAnalogOutput(side)Get the redstone output signal strength for a specific side.
getAnalogueOutput(side)Get the redstone output signal strength for a specific side.
getAnalogInput(side)Get the redstone input signal strength for a specific side.
getAnalogueInput(side)Get the redstone input signal strength for a specific side.
setBundledOutput(side, output)Set the bundled cable output for a specific side.
getBundledOutput(side)Get the bundled cable output for a specific side.
getBundledInput(side)Get the bundled cable input for a specific side.
testBundledInput(side, mask)Determine if a specific combination of colours are on for the given side.
getSides()Source

Returns a table containing the six sides of the computer. Namely, "top", "bottom", "left", "right", "front" and "back".

Returns

  1. { string... } A table of valid sides.
setOutput(side, on)Source

Turn the redstone signal of a specific side on or off.

Parameters

  1. side string The side to set.
  2. on boolean Whether the redstone signal should be on or off. When on, a signal strength of 15 is emitted.
getOutput(side)Source

Get the current redstone output of a specific side.

Parameters

  1. side string The side to get.

Returns

  1. boolean Whether the redstone output is on or off.

See also

getInput(side)Source

Get the current redstone input of a specific side.

Parameters

  1. side string The side to get.

Returns

  1. boolean Whether the redstone input is on or off.
setAnalogOutput(side, value)Source

Set the redstone signal strength for a specific side.

Parameters

  1. side string The side to set.
  2. value number The signal strength between 0 and 15.

Throws

  • If value is not betwene 0 and 15.

setAnalogueOutput(side, value)Source

Set the redstone signal strength for a specific side.

Parameters

  1. side string The side to set.
  2. value number The signal strength between 0 and 15.

Throws

  • If value is not betwene 0 and 15.

getAnalogOutput(side)Source

Get the redstone output signal strength for a specific side.

Parameters

  1. side string The side to get.

Returns

  1. number The output signal strength, between 0 and 15.

See also

getAnalogueOutput(side)Source

Get the redstone output signal strength for a specific side.

Parameters

  1. side string The side to get.

Returns

  1. number The output signal strength, between 0 and 15.

See also

getAnalogInput(side)Source

Get the redstone input signal strength for a specific side.

Parameters

  1. side string The side to get.

Returns

  1. number The input signal strength, between 0 and 15.
getAnalogueInput(side)Source

Get the redstone input signal strength for a specific side.

Parameters

  1. side string The side to get.

Returns

  1. number The input signal strength, between 0 and 15.
setBundledOutput(side, output)Source

Set the bundled cable output for a specific side.

Parameters

  1. side string The side to set.
  2. output number The colour bitmask to set.

See also

getBundledOutput(side)Source

Get the bundled cable output for a specific side.

Parameters

  1. side string The side to get.

Returns

  1. number The bundle cable's output.
getBundledInput(side)Source

Get the bundled cable input for a specific side.

Parameters

  1. side string The side to get.

Returns

  1. number The bundle cable's input.

See also

testBundledInput(side, mask)Source

Determine if a specific combination of colours are on for the given side.

Parameters

  1. side string The side to test.
  2. mask number The mask to test.

Returns

  1. boolean If the colours are on.

Usage

See also