Posted 06 June 2014 - 06:25 PM
The maintenance turtle is a turtle variation. It can't move regularily, instead, it moves on rails. However, in turn, it moves very quickly and can move along a pre-made path with little programming. It's great for travelling along mineshafts.
Suggested Implementation Details:
Suggested Implementation Details:
- Doesn't have the standard turtle movement functions (turtle.forward, turtle.back, …) but instead uses the functions below in order to work with rails efficiently.
- turtle.advance(n) - moves n blocks in the movement direction. Does not block the program flow. Negative values make it move in the opposite direction of the movement direction. A value of 0 makes it move infinitely until the turtle's movement is interrupted.
- turtle.cancelMove() - immediately stops the turtle's movement.
- arrival - an event that gets queued when the turtle has arrived at the end of its rail or when turtle.advance has finished. Should have the distance travelled as an event parameter.
- turtle.setSpeed(n) - sets the turtle's movement speed in blocks/tick.
- turtle.getSpeed() - gets the turtle's movement speed.
- turtle.setMoveDir() - sets the movement direction to the current direction the turtle is facing. This allows the turtle to move sideways along a rail.
- turtle.getMoveDir() - returns the current movement direction (north/south/west/east).
- Turning is still possible, even when moving, since turtle.setMoveDir takes care of the movement direction.
- Otherwise, it behaves just like a regular turtle.
- Bonus: Wears a hard hat :)/>.