skyrtle

Functions for turtles

calcFacing()Get the current facing of the turtle.
forward([blocks=1])Move the turtle forward N (default 1) blocks.
back([blocks=1])Move the turtle backward N (default 1) blocks.
up([blocks=1])Move the turtle up N times.
down([blocks=1])Move the turtle down N times.
turnLeft([turns=1])Turn the turtle left N times.
turnRight([turns=1])Turn the turtle right N times.
getFacing()Get the current facing of the turtle.
setFacing(dir)Set the current facing of the turtle
getPosition()Get the current position of the turtle.
setPosition(x, y, z)Set the current position of the turtle.
hijack(gps)Hijack the turtle API and replace it with Skyrtle functions.
restore()Restore the turtle API and the GPS api
farmVarious farming functions
calcFacing()Source

Get the current facing of the turtle.

Returns

  1. number Current facing of the turtle.

Or

  1. false GPS isn't available.
forward([blocks=1])Source

Move the turtle forward N (default 1) blocks.

Parameters

  1. blocks? number = 1 The number of blocks to move, defaults to 1.

Returns

  1. boolean Whether or not the turtle was able to move the amount of blocks.
back([blocks=1])Source

Move the turtle backward N (default 1) blocks.

Parameters

  1. blocks? number = 1 The number of blocks to move, defaults to 1.

Returns

  1. boolean Whether or not the turtle was able to move the amount of blocks.
up([blocks=1])Source

Move the turtle up N times.

Parameters

  1. blocks? number = 1 The number of blocks to move, defaults to 1.

Returns

  1. boolean Whether or not the turtle was able to move the amount of blocks.
down([blocks=1])Source

Move the turtle down N times.

Parameters

  1. blocks? number = 1 The number of blocks to move, defaults to 1.

Returns

  1. boolean Whether or not the turtle was able to move the amount of blocks.
turnLeft([turns=1])Source

Turn the turtle left N times.

Parameters

  1. turns? number = 1 How many times to turn the turtle, defaults to 1.

Returns

  1. boolean Whether or not the turtle was able to turn.
turnRight([turns=1])Source

Turn the turtle right N times.

Parameters

  1. turns? number = 1 How many times to turn the turtle, defaults to 1.

Returns

  1. boolean Whether or not the turtle was able to turn.
getFacing()Source

Get the current facing of the turtle.

Returns

  1. number The facing of the turtle represented as a number.
  2. string The facing of the turtle represented as a string.
setFacing(dir)Source

Set the current facing of the turtle

Parameters

  1. dir The facing of the turtle in number or string form, 0 = north, 1 = east, 2 = south, 3 = west.
getPosition()Source

Get the current position of the turtle.

Returns

  1. number X coordinate of the turtle.
  2. number Y coordinate of the turtle.
  3. number Z coordinate of the turtle.
setPosition(x, y, z)Source

Set the current position of the turtle.

Parameters

  1. x number X coordinate of the turtle.
  2. y number Y coordinate of the turtle.
  3. z number Z coordinate of the turtle.
hijack(gps)Source

Hijack the turtle API and replace it with Skyrtle functions.

Parameters

  1. gps boolean Whether or not to replace the GPS api.

Returns

  1. boolean Whether or not the changes were applied successfully.
restore()Source

Restore the turtle API and the GPS api

farmSource

Various farming functions

check()The default check
farm(length, width, check)A standard farm function, runs the check function and if it passes it will dig down, and place down the seed.
check()Source

The default check

Returns

  1. boolean Whether or not to farm the item
  2. string What to replace it with.
farm(length, width, check)Source

A standard farm function, runs the check function and if it passes it will dig down, and place down the seed.

Parameters

  1. length number How far the turtle should go.
  2. width number How many blocks to the right the turtle should go.
  3. check function Whether or not the turtle should dig, and if it does, what item it should place down as a seed. The default check checks for a wheat growth state of 7. The returns should be a boolean, and a string for the item name. The default check function is skyrtle.farm.check