sm.pipeGraph

Pipe utility functions.

Constants:

Functions:

  • getContainerPath
  • getContainerShapeToCollectTo
  • getContainerShapeToSpendFrom
  • getInputContainers
  • getInteractableConditionTicks
  • getMatchingPipedContainers
  • getOutputContainers
  • releaseLightingOverride
  • removeAutomatedTask
  • removeAutomatedTasks
  • requestLightingOverride
  • setAutomatedTask
  • setInteractableCondition
  • setParallelLimit

  • sm.pipeGraph.direction table

    Pipe direction types

    any
    incoming
    outgoing

    sm.pipeGraph.getContainerPath(requester, target, direction?)

    Client only

    Returns a table of shapes on the path between the requesting shape and target container shape.

    Parameters:

    TypeNameDescription
    ShaperequesterThe requesting shape.
    ShapetargetThe target container shape.
    integerdirection?The direction to fetch in. Defaults to sm.pipeGraph.direction.any (Optional)

    Returns:

    TypeDescription
    tableshapes The shapes on the path between requesting shape to target. Requester not included in table.

    sm.pipeGraph.getContainerShapeToCollectTo(requester, items, quantities)

    Returns a chest which allows for collection of specified items of the specified quantities.

    Parameters:

    TypeNameDescription
    ShaperequesterThe shape connected to the pipe graph who requests the information.
    tableitemsThe uuids of items to check.
    tablequantitiesThe number of items of each uuid. Needs to match the number of uuids.

    Returns:

    TypeDescription
    Shapecontainer The shape of the container which was the first one that allows the collection.

    sm.pipeGraph.getContainerShapeToSpendFrom(requester, item, quantities)

    Returns a chest which allows for spending of specific item with a given quantity.

    Parameters:

    TypeNameDescription
    ShaperequesterThe shape connected to the pipe graph who requests the information.
    UuiditemThe uuid of the target item.
    numberquantitiesThe target spending amount.

    Returns:

    TypeDescription
    Shapecontainer The shape of the container which was the first one that allows spending.

    sm.pipeGraph.getInputContainers(requester)

    Returns a table of all connected input containers sorted by closest first. If the asking shape doesn't have input and output directions it returns all connected containers.

    Parameters:

    TypeNameDescription
    ShaperequesterThe shape connected to the pipe graph who's connected chests you want.

    Returns:

    TypeDescription
    tablecontainers A table of connected container shapes sorted by closest first.

    sm.pipeGraph.getInteractableConditionTicks(requester)

    Server only

    Returns the remaining of special condition, nil if no data is available.

    return integer: remainingTicks The remaining ticks of the special condition.

    Parameters:

    TypeNameDescription
    ShaperequesterThe requesting shape.

    sm.pipeGraph.getMatchingPipedContainers(originInteractable)

    Returns the containers of all chests connected to the given shape through the pipe connections. Will only return containers from shapes of the same type as the original.

    Parameters:

    TypeNameDescription
    InteractableoriginInteractableThe interactable where the search will start from.

    Returns:

    TypeDescription
    tablecontainers The container of the originInteractable as well as those of the same type connected through pipes.

    sm.pipeGraph.getOutputContainers(requester)

    Returns a table of all connected output containers sorted by closest first. If the asking shape doesn't have input and output directions it returns all connected containers.

    Parameters:

    TypeNameDescription
    ShaperequesterThe shape connected to the pipe graph who's connected chests you want.

    Returns:

    TypeDescription
    tablecontainers A table of connected container shapes sorted by closest first.

    sm.pipeGraph.releaseLightingOverride(requester)

    Client only

    Releases any glow and UV overrides made by the shape.

    Parameters:

    TypeNameDescription
    ShaperequesterThe requesting shape.

    sm.pipeGraph.removeAutomatedTask(requester, item)

    Server only

    Removes all stored automated tasks capable of producing the specified item from a producing shape.

    Parameters:

    TypeNameDescription
    ShaperequesterThe requesting shape.
    UuiditemThe production to stop.

    sm.pipeGraph.removeAutomatedTasks(requester)

    Server only

    Removes any stored automated tasks for the requesting shape.

    Parameters:

    TypeNameDescription
    ShaperequesterThe requesting shape.

    sm.pipeGraph.requestLightingOverride(requester, target, uvIndex, glow)

    Client only

    Requests a glow and UV override for pipes between requesting shape and target container.

    Parameters:

    TypeNameDescription
    ShaperequesterThe requesting shape.
    ShapetargetThe target container shape.
    integeruvIndexThe uv frame index for the affected pipes. Ranges 0 to 3.
    numberglowThe glow multiplier of the pipes.

    sm.pipeGraph.setAutomatedTask(requester, recipe, parallel?)

    Server only

    Sets an automated task to be performed by the pipe graph when the body is unloaded.

    Parameters:

    TypeNameDescription
    ShaperequesterThe shape which requests the automated process.
    tablerecipeA table with information on the recipe. Uses the crafter recipe format. Can have "craftTime", "quantity", "itemId", "externalContainers"(containers targeted outside pipe graph for consumption, example: refinery), "selfOutputContainer"(if the shape has it's own collection container), "ingredientList", "randomCraftList" random weighted crafts (see prospector), "specialCrafting" used to target specific container slots with custom information (see ore crusher).
    booleanparallel?Whether the craft tasks should be carried out in parallel or not, off by default. A parallel task will be carried out independently of other automated tasks on this shape. (Optional)

    sm.pipeGraph.setInteractableCondition(requester, condition)

    Server only

    Sets special conditions for allowing an interactable to craft.

    Parameters:

    TypeNameDescription
    ShaperequesterThe requesting shape.
    tableconditionValues for special conditions to allow crafting. Uses "uuid", "tickFrequency", "remainingTicks"(optional), "consumptionCount", "onlyExternal". See Prospector.lua for example.

    sm.pipeGraph.setParallelLimit(requester, amount)

    Server only

    Sets the maximum amount of parallel crafts, 65535 if not set.

    Parameters:

    TypeNameDescription
    ShaperequesterThe requesting shape.
    integeramountThe number of parallel crafts allowed to be done at once.