CreateMod/wiki/Lua-Sequenced-Gearshift.md
caelwarner fac1ebcd3f
Added documentation for most peripherals
- Lua documentation has been added for all peripherals except the train station (not looking forward to writing that one)
- This documentation will be added to the GitHub wiki pages
2023-03-11 16:12:58 -08:00

1.6 KiB

Method Description
rotate(angle, [modifier]) Rotates shaft by a set angle
move(distance, [modifier]) Rotates shaft to move Piston/Pulley/Gantry by a set distance
isRunning() Checks if the gearshift is spinning

rotate(angle, [modifier])

Rotates connected components by a set angle.

Parameters

  • angle: number Angle to rotate shaft by. Must be a positive integer.
  • modifier?: number = 1 Speed modifier which can be used to reverse rotation. Must be an integer within range of [-2..2]. Values out of this range will cause the modifier to revert to its default of 1.

move(distance, [modifier])

Rotates connected components to move connected piston, pulley or gantry contractions by a set distance.

Parameters

  • distance: number Distance to move connected piston, pulley or gantry contraptions by. Must be a positive integer.
  • modifier?: number = 1 Speed modifier which can be used to reverse rotation. Must be an integer within range of [-2..2]. Values out of this range will cause the modifier to revert to its default of 1.

isRunning()

Checks if the sequenced gearshift is currently spinning.

Returns

  • boolean Whether the sequenced gearshift is currently spinning.