This module provides user logic functionality.

It is available only on Snipe Kit server.

Constructor

Methods

get (c:ClientKit, params:Params):{name:String, errorCode:String}

kit/logic.get

Gets user logic state, both trees and nodes. Will also try to enter all active trees and exit nodes that don't have any checks. Also checks all active logic timers and fails logic if necessary.

Input:

  • noDump - Bool. If set to true, will not return user logic dump in response.

Output:

Error codes:

  • ok - Operation successful.

incVar (c:ClientKit, params:Params):{name:String, errorCode:String}

kit/logic.incVar

Increases a client variable in user logic nodes that handle it. If the variable does not defined in any active logic node, nothing happens.

Input:

  • name - String. Client variable name.
  • treeID - Int. (optional) Logic tree ID. Tree has to be active for this user. If not given, trigger will run through all active logic trees.

Output:

  • name - String. Client variable name.
  • errorCode - String. Operation error code.

Error codes:

  • ok - Operation successful.