Turtle - edggy/ComputerCraft GitHub Wiki

Basic Turtles

Name Return Description
move([dir]) location Try to move the turtle in the given direction
turn(amount) dir Turn the turtle left the given amount of times. e.g. 3 would turn right
attack([dir]) success Attacks in the given direction.
compare([dir], [slot]) success Detects if the block in the given direction is the same as the one in the currently selected slot.
compare(slot1, [slot2]) success Compare the current selected slot and the given slot or two given slots to see if the items are the same.
detect([dir]) success Detects if there is a block in the given direction. Does not detect mobs.
dig([dir], [slot]) success Breaks the block in the given direction. Places the block in the given slot. With hoe: tills the dirt instead.
till([dir]) success Tills the dirt in the given direction. Only works if hoe is equipped.
drop([amount],[dir],[slot]) success Drops the given amount of items in the selected slot to the given direction.
equip(side, [slot]) success Attempts to equip an item in the given slot to the given side, returns false if already equipped.
unequip(side, [slot]) success Attempts to unequip an item to the given slot from the given side, returns false if not equipped.
inspect() slotID Indicates the currently selected inventory slot
inspect([dir]) item Get details of a block in the given direction.
inspect([slot]) item Get details of an item in a particular slot
place([dir], [slot], [signText]) success Places a block of the selected slot in the given direction. Engrave signText on signs if provided. Collects water or lava if the given slot is an empty bucket.
suck([amount], [dir], [slot]) success Picks up an item stack of any number, from the ground or an inventory in the given direction, then places it in the given slot.
craft([amount], [slot]) success Craft items using ingredients anywhere in the turtle's inventory and place results in the given slot.
fuel() fuel Get a table with the current fuel amount, the fuel limit and the refuel function
fuel().level fuel Returns the current fuel level of the turtle, this is the number of blocks the turtle can move.
fuel().limit maxFuel Returns the maximum amount of fuel a turtle can store - by default, 20,000 for regular turtles, 100,000 for advanced.
fuel().burn([amount], [slot]) fuel If the current selected slot contains a fuel item, it will consume it to give the turtle the ability to move.
swap(slot1, [slot2], [drop]) success Swaps items from one slot to another. If drop is true then the turtle will drop an item to swap it.
transferTo(slot1, [amount], [slot2]) success Transfers quantity items from one slot to another.
sort([smaller], [dir], [drop]) success Sorts the items in given direction based on the given function. If drop is true then the turtle will drop an item to swap it.
fill([dir], [slot]) success If the slot has a bucket and there is an Ender IO Fluid Tank in the given direction, then fill the bucket if it is empty or visa versa.
dump([dir], [slot]) success If the slot has a full bucket, dump it either on the ground or in an Ender IO Fluid Tank in the given direction

Defaults

Name Value
Direction Forward
Slot Currently selected slot
Amount As many as possible
Drop False
⚠️ **GitHub.com Fallback** ⚠️