piston

A small api to control a Create Mechanical Piston The setup requires (by default) a redstone line to lower the piston on the right, and a redstone line to raise the piston on the left. The recommended setup for the sequenced gearshifts is: spin 90° on double input speed.

create([height=0, maxHeight])Create a piston object.
create([height=0, maxHeight])Source

Create a piston object.

Parameters

  1. height? number = 0 Current height of the piston. If not specified will pulse piston 50 times down.
  2. maxHeight number The maximum height of the piston.

Types

piston

Piston object.

piston.curHeightSource

Current height of the piston, this should always match the piston in the world.

piston.raise([blocks=1])Source

Raise the piston a set amount of blocks.

Parameters

  1. blocks? number = 1 Amount of blocks to raise the piston by.
piston.curHeight = 0Source

Current height of the piston, this should always match the piston in the world.

piston.lower([blocks=1])Source

Lower the piston a set amount of blocks.

Parameters

  1. blocks? number = 1 Amount of blocks to lower the piston by
piston.curHeight = 0Source

Current height of the piston, this should always match the piston in the world.

piston:ground()Source

Lower the piston to the bottom.

piston:max()Source

Raise the piston to it's maximum extension