diff --git a/docs/turtles/pattern_turtle.md b/docs/turtles/pattern_turtle.md new file mode 100644 index 00000000..c3945134 --- /dev/null +++ b/docs/turtles/pattern_turtle.md @@ -0,0 +1,96 @@ +# Pattern Grid Turtle + +!!! picture inline end +{ align=right } + +The Pattern Grid turtle allows you to inspect and craft Refined Storage patterns. + +
+ +--- + +## Functions + +--- + +### getDetails +``` +getDetails([, slot: number]) -> table | false, string +``` + +Gets information about a pattern in a given slot, or the currently selected slot if none is provided. + +Returns information about the pattern in the same structure as is returned by [getPatterns](/../guides/storage_system_functions#getPatterns), including the pattern's input items and outputs. + +--- + +### buildCrafting +``` +buildCrafting(recipe: table[, fuzzy: boolean]) -> table | false, string +``` + +Writes a crafting recipe to the pattern item in the selected slot. + +The input structure is a Lua array, where the keys represent slot number (1-9) in the crafting grid, and the values are item names as strings. For example, the recipe for a stone pickaxe: +``` +{ + [1] = "minecraft:cobblestone", + [2] = "minecraft:cobblestone", + [3] = "minecraft:cobblestone", + [5] = "minecraft:stick", + [8] = "minecraft:stick", +} +``` +Optionally, a boolean can be passed to enable *fuzzy mode* for the pattern. + +Returns the output of getDetails() on the newly built pattern, or *false* and the error as a string. + +--- + +### buildProcessing +``` +buildProcessing(recipe: table) -> table | false, string +``` + +Writes a processing recipe to the pattern item in the selected slot. + +The input structure is a Lua table containing two arrays, one for *inputs* and the other for *outputs*. The basic format for an input/output resource is a table with its resource *name* as a string and an integer *count*; inputs can optionally include an array of *alts*, or alternate tags to match against. Item resources are counted as individual items, while fluid resources are counted in milliBuckets. +``` +{ + inputs = { + [1] = { name = "