Trigger Reference of GS2-Idle Script

Reference of event triggers that call extended scripts

Trigger

receive

Receive Rewards

Synchronous Execution Script

Script and Receive Rewards are executed synchronously in that order.

Request
TypeDescription
namespaceNamespaceNamespace
categoryCategoryModelCategory Model
userIdstringUser ID executing reward receive
statusStatusStatus
acquireActionsAcquireAction[]Rewards
configConfig[]Set values to be applied to transaction variables
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow receive
ratefloat1.00 ~ 1000Acquisition quantity rate
Implementation Example
namespace = args.namespace
category = args.category
userId = args.userId
status = args.status
acquireActions = args.acquireActions
config = args.config

result = {
  permit=permit,
  rate=rate
}

Asynchronous Execution Script

The script will run after the Receive Rewards is executed.

Request
TypeDescription
namespaceNamespaceNamespace
categoryCategoryModelCategory Model
userIdstringUser ID performing the idle
oldStatusStatusStatus
newStatusStatusStatus
acquireActionsAcquireAction[]Rewards
configConfig[]Set values to be applied to transaction variables
Result
TypeRequiredDefaultValue LimitsDescription
Implementation Example
namespace = args.namespace
category = args.category
userId = args.userId
oldStatus = args.oldStatus
newStatus = args.newStatus
acquireActions = args.acquireActions
config = args.config

result = {
}

overrideAcquireActions

Script for dynamically determining idle reward acquire actions

Synchronous Execution Script

Script and Script for dynamically determining idle reward acquire actions are executed synchronously in that order.

Request
TypeDescription
namespaceNamespaceNamespace
categoryModelCategoryModelCategory Model
userIdstringUser ID
Result
TypeRequiredDefaultValue LimitsDescription
acquireActionsAcquireActionList[]
1 ~ 100 itemsList of acquire actions for each waiting time
Assuming that the waiting time is “X minutes”,
“X / rewardIntervalMinutes” will be the number of rewards that can be received, but by looping the elements specified in this array, different rewards can be given for each waiting time.
Implementation Example
namespace = args.namespace
categoryModel = args.categoryModel
userId = args.userId

result = {
  acquireActions=acquireActions
}