Skip to content

Latest commit

 

History

History
315 lines (251 loc) · 11.3 KB

3.1-INTEGRATION.md

File metadata and controls

315 lines (251 loc) · 11.3 KB

Integration

API

AsstAppendTask

Prototype

TaskId ASSTAPI AsstAppendTask(AsstHandle handle, const char* type, const char* params);

Description

Appends a task.

Return Value

  • TaskId
    The task ID if the task is successfully appended, for the following configuration; 0 if the task is not successfully appended.

Parameter Description

  • AsstHandle handle
    Instance handle
  • const char* type
    Task type
  • const char* params
    Task parameters in JSON
List of Task Types
  • StartUp
    Start-up
// Corresponding task parameters
{
    "enable": bool,             // Whether to enable this task, optional, true by default
    "client_type": string,      // Client version, optional, empty by default
                                // Options: "Official" | "Bilibili"
    "start_game_enabled": bool   // Whether to launch client automatically, optional, false by default
}
  • Fight
    Operation
// Corresponding task parameters
{
    "enable": bool,             // Whether to enable this task, optional, true by default
    "stage": string,            // Stage name, optional, by default crrent / last stage. Editing in run-time is not supported.
                                // Supports all mainline stages, such as "1-7", "S3-2", etc.
                                // Supports some of the special stages, such as "CE-6", etc. (Please refer to C# integration example.)
    "medicine": int,            // Maximum number Sanity Potion used, optional, by default 0
    "stone": int,               // Maximum number of Originite Prime used, optional, by default 0
    "times": int,               // Maximum times, optional, by default infinite
    "drops": {                  // Specifying the number of drops, optional, no specification by default
        "30011": int,           // Key: item ID; value: number of items. Key refers to resource/item_index.json
        "30062": int            // OR combination
    },
    /* Items are combined with OR operators, i.e. the task stops when any condition meets. */

    "report_to_penguin": bool,  // Whether to upload data to Pengiun Stats, optional, by default false
    "penguin_id": string,       // Penguin Stats ID, optional, by default empty. Available only when `report_to_penguin` is `true`.
    "server": string,           // Server, optional, by default "CN", will affect the drop recognition and upload
                                // Options:"CN" | "US" | "JP" | "KR"
    "client_type": string,      // Client versino, optional, empty by default. Used to reconnect after the game crashed. Empty means to disable this feature
                                // Options: "Official" | "Bilibili"
    "DrGrandet": bool,          // Save sanity by using Originites, Optional, false by default. effective only when Originites may be used
                                // Wait in the using Originites confirmation screen until the 1 point of sanity has been restored and then immediately use the Originite.
}
  • Recruit
    Recruitment
// Corresponding task parameters
{
    "enable": bool,             // Whether to enable this task, optional, by default true
    "refresh": bool,            // Whether to refresh 3★ tags, optional, by default false
    "select": [                 // Tag level to click, required
        int,
        ...
    ],
    "confirm": [                // Tag level for confirmation, required. Can be set to empty array for calculation only.
        int,
        ...
    ],
    "times": int,               // The times of recruitment, optional, by default 0. Can be set to 0 for calculation only.
    "set_time": bool,           // Whether to set time to 9 hours, available only when `times` is 0, optional, by default true
    "expedite": bool,           // Whether to use expedited plans, optional, by default false
    "expedite_times": int,      // The times of using expedited plans, available only when `expedite` is `true`
                                // Optional, by default infinity until `times` reaches its limitation.
    "skip_robot": bool,         // Whether to skip when robot tag is recognized, optional, skip by default.
    "recruitment_time": {       // Tags level and set duration in minutes, optional, by default 540 (i.e. 9 hours)
        "3": int,
        "4": int,
        ...
    },
    "report_to_penguin": bool,  // Whether to report to Penguin Stats, optional, by default false.
    "penguin_id": string,       // Penguin Stats user id, optional, by default empty. Valid only if report_to_penguin is true.
    "report_to_yituliu": bool,  // Whether to report to YITULIU, optional, by default false.
    "yituliu_id": string,       // YITULIU user id, optional, by default empty. Valid only if report_to_yituliu is true.
}
  • Infrast
    Infrastructure shifting
{
    "enable": bool,             // Whether to enable this task, optional, by default true
    "mode": int,            // Shift mode, reserved, optional. Editing in run-time is not supported.
    "facility": [           // Facilities for shifting, required. Editing in run-time is not supported.
        string,             // Facility name: "Mfg" | "Trade" | "Power" | "Control" | "Reception" | "Office" | "Dorm"
        ...
    ],
    "drones": string,       // Usage of drones, optional, by default "_NotUse"
                            // "_NotUse"、"Money"、"SyntheticJade"、"CombatRecord"、"PureGold"、"OriginStone"、"Chip"
    "threshold": float,     // Morale threshold with range [0, 1.0], optional, by default 0.3
    "replenish": bool,      // Whether to replenish Originium Shard, optional, by default false
}
  • Visit
    Visiting reception room of friends
// Corresponding task parameters
{
    "enable": bool          // Whether to enable this task, optional, by default true
}
  • Mall
    Collecting Credits and auto-purchasing Will buy items in order following buy_first list, buy other items from left to right ignoring items in blacklist, and buy other items from left to right ignoring the blacklist while credit overflows.
// Corresponding task parameters
{
    "enable": bool,         // Whether to enable this task, optional, by default true
    "shopping": bool,       // Whether to buy items from the store, optional, by default false. Editing in run-time is not supported.
    "buy_first": [          // Items to be purchased with priority, optional. Editing in run-time is not supported.
        string,             // Item name, e.g. "招聘许可" (Recruitment Permit), "龙门币" (LMD), etc.
        ...
    ],
    "blacklist": [          // Blacklist, optional. Editing in run-time is not supported.
        string,             // Item name, e.g. "加急许可" (Expedited Plan), "家具零件" (Furniture Part), etc.
        ...
    ],
    "force_shopping_if_credit_full": bool // Whether to ignore the Blacklist if credit overflows, by default true
}
  • Award
    Collecting daily awards.
// Corresponding task parameters
{
    "enable": bool          // Whether to enable this task, optional, by default true
}
  • Roguelike
    Integrated Strategies
{
    "enable": bool,         // Whether to enable this task, optional, by default true
    "theme": string,        // Name of the theme, optional, by default "Phantom"
                            // Phantom - 傀影与猩红血钻
                            // Mizuki  - 水月与深蓝之树
    "mode": int,            // Mode, optional, by default 0
                            // 0 - For candle, plays as much as you can with stable strategy
                            // 1 - For Originium Ingots, exits after first level
                            // 2 - For both, Plays until invests
                            // 3 - For pass, plays as much as you can with aggressive strategy
    "starts_count": int,    // Number of starts, optional, by default INT_MAX
    "investments_count": int,
                            // Number of investments, optional, by default INT_MAX
    "stop_when_investment_full": bool,
                            // Stop the task when investment is full, optional, by default false          
    "squad": string,        // Squad name like "assault squad", optional, by default "Default Squad"
    "roles": string,        // Roles, optional
    "core_char": string,     // Operator name, optional. Will recognize auto-selection of levels.
    "use_support": bool, 	// Whether "core_char" is a support unit, optional, by default false
    "use_nonfriend_support": bool 	// Whether support unit can be non-friend support unit, optional, by default false, valid when use_support=true
}
  • Copilot
    Copilot auto-combat feature
{
    "enable": bool,             // Whether to enable this task, optional, by default true
    "filename": string,         // Filename and path of the task JSON, supporting absolute/relative paths. Editing in run-time is not supported.
    "formation": bool           // Whether to "quick build", optional, by default false. Editing in run-time is not supported.
}

For more details about auto-copilot JSON, please refer to Copilot Schema

  • Depot Depot recognition
// Corresponding task parameters
{
    "enable": bool          // Whether to enable this task, optional, by default true
}

AsstSetTaskParams

Prototype

bool ASSTAPI AsstSetTaskParams(AsstHandle handle, TaskId id, const char* params);

Description

Set task parameters

Return Value

  • bool
    Whether the parameters are successfully set.

Parameter Description

  • AsstHandle handle
    Instance handle
  • TaskId task
    Task ID, the return value of AsstAppendTask
  • const char* params
    Task parameter in JSON, same as AsstAppendTask For those fields that do not mention "Editing in run-time is not supported" can be changed during run-time. Otherwise these changes will be ignored when the task is running.

AsstSetStaticOption

Prototype

bool ASSTAPI AsstSetStaticOption(AsstStaticOptionKey key, const char* value);

Description

Set process-level parameters

Return Value

  • bool
    Is the setup successful

Parameter Description

  • AsstStaticOptionKey key
    key
  • const char* value
    value
List of Key and value

None

AsstSetInstanceOption

Prototype

bool ASSTAPI AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, const char* value);

Description

Set instance-level parameters

Return Value

  • bool
    Is the setup successful

Parameter Description

  • AsstHandle handle
    handle
  • AsstInstanceOptionKey key
    key
  • const char* value
    value
List of Key and value
    enum InstanceOptionKey
    {
        Invalid = 0,
        // Deprecated // MinitouchEnabled = 1,   // Is minitouch enabled
                                // If you can't use minitouch, it's useless to turn it on.
                                // "1" - on,"0" - off
        TouchMode = 2,          // Touch mode, minitouch by default
                                // minitouch | maatouch | adb
        DeploymentWithPause = 3,    // Deployment with Pause (Works for IS, Copilot and 保全派驻)
                                    // "1" | "0"
    };