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

    The basic item-only digitizer peripheral.

    This peripheral also exposes the inherited InventoryAPI methods (size, list, getItemDetail, getItemLimit, pushItems, and pullItems) and ConfigurationAPI.getConfiguration().

    Digital identifiers are opaque 16-byte binary strings. Preserve them byte-for-byte; they are not text, UUIDs, or safe to pass through a text-only encoding without an explicit binary encoding.

    Unlike the advanced digitizer, failures from this API throw Lua errors.

    interface Digitizer {
        digitize(slot?: number): string;
        digitizeAmount(amount: number, slot?: number): string;
        getDecayEnabled(): boolean;
        getDecayTicks(): number;
        getIDInfo(id: string): ItemIDInfo;
        refresh(id: string): void;
        rematerialize(id: string): number;
        rematerializeAmount(id: string, amount: number): number;
    }

    Hierarchy

    Index
    • Removes the complete stack from an internal inventory slot and digitizes it.

      Parameters

      • Optionalslot: number

        One-based inventory slot. Defaults to slot 1.

      Returns string

      A new opaque 16-byte binary identifier.

      A Lua error if the slot is empty or the slot is invalid.

    • Removes and digitizes an exact number of items from an internal slot.

      Parameters

      • amount: number

        Positive number of items to remove.

      • Optionalslot: number

        One-based inventory slot. Defaults to slot 1.

      Returns string

      A new opaque 16-byte binary identifier.

      A Lua error if amount is not positive, the slot is empty, or fewer items are present.

    • Resets an identifier's decay deadline to current game time plus getDecayTicks().

      Parameters

      • id: string

        Opaque binary item identifier.

      Returns void

      A Lua error if the identifier is unknown or has decayed.

    • Rematerializes as much of an item identifier as the internal inventory can accept.

      Parameters

      • id: string

        Opaque binary identifier returned by a digitize method.

      Returns number

      The number of items inserted. The identifier remains valid if items remain.

      A Lua error if the identifier is unknown or has decayed.

    • Attempts to insert an exact requested portion into the internal inventory.

      Parameters

      • id: string

        Opaque binary item identifier.

      • amount: number

        Positive number of items requested; it cannot exceed the stored count.

      Returns number

      The number actually inserted, which may be lower when inventory space is limited.

      A Lua error for an invalid or decayed identifier, invalid amount, or insufficient stored count.