@siredvin/typed-peripheral-digitalitems
    Preparing search index...

    The advanced item, fluid, and energy digitizer peripheral.

    This peripheral also exposes the inherited InventoryAPI methods (size, list, getItemDetail, getItemLimit, pushItems, and pullItems) and ConfigurationAPI.getConfiguration(). Its internal inventory can be addressed as self only for item operations.

    Digital identifiers are opaque 16-byte binary strings and are scoped to a mode. Preserve them byte-for-byte and pass the same mode to get, refresh, and rematerialize.

    interface AdvancedDigitizer {
        digitize(
            mode: "item",
            source?: string,
            filter?: string | number | LuaTable<AnyNotNil, any>,
            limit?: number,
            destination?: string,
        ): LuaMultiReturn<[null, string] | [string, null]>;
        digitize(
            mode: "fluid" | "energy",
            source?: string,
            filter?: string,
            limit?: number,
            destination?: string,
        ): LuaMultiReturn<[null, string] | [string, null]>;
        get(mode: "item", id: string): ItemIDInfo;
        get(mode: "fluid", id: string): FluidIDInfo;
        get(mode: "energy", id: string): EnergyIDInfo;
        refresh(mode: "item" | "fluid" | "energy", id: string): boolean;
        rematerialize(
            mode: "item" | "fluid" | "energy",
            id: string,
            limit?: number,
            destination?: string,
        ): LuaMultiReturn<[null, string] | [number, null]>;
    }

    Hierarchy

    Index
    • Digitizes items from the internal inventory or an attached item storage.

      Parameters

      • mode: "item"

        The item storage mode.

      • Optionalsource: string

        Peripheral name to extract from, or self. Defaults to self.

      • Optionalfilter: string | number | LuaTable<AnyNotNil, any>

        One-based slot, item name, or item query table. Defaults to any item.

      • Optionallimit: number

        Optional amount from 1 through half of itemStackLimit.

      • Optionaldestination: string

        Existing item identifier to merge into; omit to create a new identifier.

      Returns LuaMultiReturn<[null, string] | [string, null]>

      On success, [id, null]; for an operational failure, [null, message].

      A Lua error for an invalid mode, filter, limit, source, or incompatible storage.

    • Digitizes fluid or energy from an attached storage peripheral.

      Parameters

      • mode: "fluid" | "energy"

        The fluid or energy storage mode.

      • Optionalsource: string

        Attached peripheral name. The default self is unsupported for these modes.

      • Optionalfilter: string

        Fluid name or energy unit; omit to accept the first available content.

      • Optionallimit: number

        Optional mB or energy-unit amount from 1 through half of the mode's configured stack limit.

      • Optionaldestination: string

        Existing same-mode identifier to merge into; omit to create a new identifier.

      Returns LuaMultiReturn<[null, string] | [string, null]>

      On success, [id, null]; for an operational failure, [null, message].

      A Lua error for an invalid mode, limit, peripheral, storage type, or use of self.

    • Refreshes an identifier's decay deadline.

      Parameters

      • mode: "item" | "fluid" | "energy"

        Storage mode associated with id.

      • id: string

        Opaque binary identifier.

      Returns boolean

      true when refreshed, or false when the identifier is missing or decayed.

      A Lua error if mode is unsupported.

    • Rematerializes items, fluid, or energy into a destination storage.

      Parameters

      • mode: "item" | "fluid" | "energy"

        Storage mode associated with id.

      • id: string

        Opaque binary identifier.

      • Optionallimit: number

        Optional amount from 1 through half of the mode's configured stack limit; defaults to all stored content.

      • Optionaldestination: string

        Peripheral name to insert into, or self for items. Defaults to self.

      Returns LuaMultiReturn<[null, string] | [number, null]>

      On success, [amount, null]; for an operational failure, [null, message].

      A Lua error for invalid arguments, inaccessible or incompatible storage, or fluid/energy use of self.