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 |
farm | Various farming functions |
- calcFacing()Source
Get the current facing of the turtle.
Returns
- number Current facing of the turtle.
Or
- false GPS isn't available.
- forward([blocks=1])Source
Move the turtle forward N (default 1) blocks.
Parameters
- blocks? number =
1
The number of blocks to move, defaults to 1.
Returns
- boolean Whether or not the turtle was able to move the amount of blocks.
- blocks? number =
- back([blocks=1])Source
Move the turtle backward N (default 1) blocks.
Parameters
- blocks? number =
1
The number of blocks to move, defaults to 1.
Returns
- boolean Whether or not the turtle was able to move the amount of blocks.
- blocks? number =
- up([blocks=1])Source
Move the turtle up N times.
Parameters
- blocks? number =
1
The number of blocks to move, defaults to 1.
Returns
- boolean Whether or not the turtle was able to move the amount of blocks.
- blocks? number =
- down([blocks=1])Source
Move the turtle down N times.
Parameters
- blocks? number =
1
The number of blocks to move, defaults to 1.
Returns
- boolean Whether or not the turtle was able to move the amount of blocks.
- blocks? number =
- turnLeft([turns=1])Source
Turn the turtle left N times.
Parameters
- turns? number =
1
How many times to turn the turtle, defaults to 1.
Returns
- boolean Whether or not the turtle was able to turn.
- turns? number =
- turnRight([turns=1])Source
Turn the turtle right N times.
Parameters
- turns? number =
1
How many times to turn the turtle, defaults to 1.
Returns
- boolean Whether or not the turtle was able to turn.
- turns? number =
- getFacing()Source
Get the current facing of the turtle.
Returns
- number The facing of the turtle represented as a number.
- string The facing of the turtle represented as a string.
- setFacing(dir)Source
Set the current facing of the turtle
Parameters
- 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
- number X coordinate of the turtle.
- number Y coordinate of the turtle.
- number Z coordinate of the turtle.
- setPosition(x, y, z)Source
Set the current position of the turtle.
Parameters
- x number X coordinate of the turtle.
- y number Y coordinate of the turtle.
- z number Z coordinate of the turtle.
- hijack(gps)Source
Hijack the turtle API and replace it with Skyrtle functions.
Parameters
- gps boolean Whether or not to replace the GPS api.
Returns
- 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
- boolean Whether or not to farm the item
- 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
- length number How far the turtle should go.
- width number How many blocks to the right the turtle should go.
- 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