List Set Item
Runs on: Shared (backend or chatbox overlay).
Replaces the item at an index and outputs the new list. The original list is not modified. An index outside the list's range returns the list unchanged.
Inputs
| Name | Type | Description |
|---|---|---|
list | list | The list to update. |
index | number | The position to replace. 0 is the first item. |
item | any | The replacement value. The accepted type is inferred from the list's inner type. |
Outputs
| Name | Type | Description |
|---|---|---|
result | list | The list with that item replaced, with the same type as the input. |
Configuration
- From:
StartorEnd. The end the index counts from. WithEnd, index0replaces the last item.
Example
To keep the last 3 raiders on an overlay at a fixed length, use List Set Item with Index 0 and From End to overwrite the most recent slot with the newest raider's name.