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
numberCurrent 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=1The number of blocks to move, defaults to 1.
Returns
booleanWhether or not the turtle was able to move the amount of blocks.
- blocks?
- back([blocks=1])Source
Move the turtle backward N (default 1) blocks.
Parameters
- blocks?
number=1The number of blocks to move, defaults to 1.
Returns
booleanWhether or not the turtle was able to move the amount of blocks.
- blocks?
- up([blocks=1])Source
Move the turtle up N times.
Parameters
- blocks?
number=1The number of blocks to move, defaults to 1.
Returns
booleanWhether or not the turtle was able to move the amount of blocks.
- blocks?
- down([blocks=1])Source
Move the turtle down N times.
Parameters
- blocks?
number=1The number of blocks to move, defaults to 1.
Returns
booleanWhether or not the turtle was able to move the amount of blocks.
- blocks?
- turnLeft([turns=1])Source
Turn the turtle left N times.
Parameters
- turns?
number=1How many times to turn the turtle, defaults to 1.
Returns
booleanWhether or not the turtle was able to turn.
- turns?
- turnRight([turns=1])Source
Turn the turtle right N times.
Parameters
- turns?
number=1How many times to turn the turtle, defaults to 1.
Returns
booleanWhether or not the turtle was able to turn.
- turns?
- getFacing()Source
Get the current facing of the turtle.
Returns
numberThe facing of the turtle represented as a number.stringThe 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
numberX coordinate of the turtle.numberY coordinate of the turtle.numberZ coordinate of the turtle.
- setPosition(x, y, z)Source
Set the current position of the turtle.
Parameters
- x
numberX coordinate of the turtle. - y
numberY coordinate of the turtle. - z
numberZ coordinate of the turtle.
- x
- hijack(gps)Source
Hijack the turtle API and replace it with Skyrtle functions.
Parameters
- gps
booleanWhether or not to replace the GPS api.
Returns
booleanWhether or not the changes were applied successfully.
- gps
- 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
booleanWhether or not to farm the itemstringWhat 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
numberHow far the turtle should go. - width
numberHow many blocks to the right the turtle should go. - check
functionWhether 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 isskyrtle.farm.check
- length