> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-Idle Transaction Actions

Specification of verify/consume/acquire transaction actions





## Consume Action



### Gs2Idle:DecreaseMaximumIdleMinutesByUserId

Decrease the maximum idle time by User ID

Subtracts the specified number of minutes from the user's maximum idle time for the given category.
The maximum idle time cannot go below zero.
If no status exists yet, it is automatically created before applying the decrease.

**Quantity specification supported: YES**

**Reversible action: YES**

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID<br>Specify `#{userId}` to substitute the currently logged-in user's ID. |
| categoryName | string |  | ✓|  |  ~ 128 chars | Category Model Name<br>The name of the category model that this status belongs to. References the category model definition which contains the reward interval, maximum idle time, acquire actions, and schedule settings used for idle reward calculation. |
| decreaseMinutes | int |  | |  | 1 ~ 2147483646 | Minutes to decrease the maximum idle time |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "categoryName": "[string]Category Model Name",
        "decreaseMinutes": "[int]Minutes to decrease the maximum idle time",
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2Idle:DecreaseMaximumIdleMinutesByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  categoryName: "[string]Category Model Name"
  decreaseMinutes: "[int]Minutes to decrease the maximum idle time"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

transaction.service("idle").consume.decrease_maximum_idle_minutes_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    categoryName="[string]Category Model Name",
    decreaseMinutes="[int]Minutes to decrease the maximum idle time",
    timeOffsetToken="[string]Time offset token",
})
```


---

## Acquire Action



### Gs2Idle:IncreaseMaximumIdleMinutesByUserId

Increase the maximum idle time by User ID

Adds the specified number of minutes to the user's maximum idle time for the given category.
The maximum idle time determines the cap on how long idle rewards can accumulate.
If no status exists yet, it is automatically created before applying the increase.

**Quantity specification supported: YES**

**Reversible action: YES**

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID<br>Specify `#{userId}` to substitute the currently logged-in user's ID. |
| categoryName | string |  | ✓|  |  ~ 128 chars | Category Model Name<br>The name of the category model that this status belongs to. References the category model definition which contains the reward interval, maximum idle time, acquire actions, and schedule settings used for idle reward calculation. |
| increaseMinutes | int |  | |  | 1 ~ 2147483646 | Minutes to increase the maximum idle time |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "categoryName": "[string]Category Model Name",
        "increaseMinutes": "[int]Minutes to increase the maximum idle time",
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2Idle:IncreaseMaximumIdleMinutesByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  categoryName: "[string]Category Model Name"
  increaseMinutes: "[int]Minutes to increase the maximum idle time"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

transaction.service("idle").acquire.increase_maximum_idle_minutes_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    categoryName="[string]Category Model Name",
    increaseMinutes="[int]Minutes to increase the maximum idle time",
    timeOffsetToken="[string]Time offset token",
})
```


---

### Gs2Idle:SetMaximumIdleMinutesByUserId

Set the maximum idle time by User ID

Sets the user's maximum idle time for the given category to the specified absolute value.
Unlike increase/decrease operations, this directly replaces the current maximum idle time.
Returns both the updated status and the status before the update, allowing the caller to see what changed.
If no status exists yet, it is automatically created before applying the value.

**Quantity specification supported: NO**

**Reversible action: NO**

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID<br>Specify `#{userId}` to substitute the currently logged-in user's ID. |
| categoryName | string |  | ✓|  |  ~ 128 chars | Category Model Name<br>The name of the category model that this status belongs to. References the category model definition which contains the reward interval, maximum idle time, acquire actions, and schedule settings used for idle reward calculation. |
| maximumIdleMinutes | int |  | |  | 1 ~ 2147483646 | Maximum idle time to set |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2Idle:SetMaximumIdleMinutesByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "categoryName": "[string]Category Model Name",
        "maximumIdleMinutes": "[int]Maximum idle time to set",
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2Idle:SetMaximumIdleMinutesByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  categoryName: "[string]Category Model Name"
  maximumIdleMinutes: "[int]Maximum idle time to set"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

transaction.service("idle").acquire.set_maximum_idle_minutes_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    categoryName="[string]Category Model Name",
    maximumIdleMinutes="[int]Maximum idle time to set",
    timeOffsetToken="[string]Time offset token",
})
```


---

### Gs2Idle:ReceiveByUserId

Receive rewards by User ID

Receives idle rewards for the specified user and category based on the accumulated idle time.
The reward amount is calculated from the elapsed idle time divided by rewardIntervalMinutes, capped by maximumIdleMinutes.
If a receiveScript is configured, it is executed before granting rewards and can modify or reject the receive operation.
An overrideAcquireActionsScriptId can also modify the acquire actions (e.g., applying rate modifiers).
After receiving, the idle timer is reset to the current time.
Returns a transaction containing the acquire actions for the calculated rewards.

**Quantity specification supported: NO**

**Reversible action: NO**

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID<br>Specify `#{userId}` to substitute the currently logged-in user's ID. |
| categoryName | string |  | ✓|  |  ~ 128 chars | Category Model Name<br>The name of the category model that this status belongs to. References the category model definition which contains the reward interval, maximum idle time, acquire actions, and schedule settings used for idle reward calculation. |
| config | List&lt;Config&gt; |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2Idle:ReceiveByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "categoryName": "[string]Category Model Name",
        "config": [
            {
                "key": "[string]Name",
                "value": "[string]Value"
            }
        ],
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2Idle:ReceiveByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  categoryName: "[string]Category Model Name"
  config: 
    - key: "[string]Name"
      value: "[string]Value"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

transaction.service("idle").acquire.receive_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    categoryName="[string]Category Model Name",
    config={
        {
            key="[string]Name",
            value="[string]Value"
        }
    },
    timeOffsetToken="[string]Time offset token",
})
```


---



