/CS2Interface

An ASF Plugin for interacting with Counter-Strike 2

Primary LanguageC#Apache License 2.0Apache-2.0

Counter-Strike 2 Interface Plugin for ArchiSteamFarm

Check out my other ArchiSteamFarm plugins

Introduction

This plugin allows you to interact with Counter-Strike 2 using ArchiSteamFarm's IPC interface.

Installation

  • Download the .zip file from the latest release
  • Unpack the downloaded .zip file to the plugins folder inside your ASF folder.
  • (Re)start ASF, you should get a message indicating that the plugin loaded successfully.

Note This plugin is only tested to work with ASF-generic. It may or may not work with other ASF variants, but feel free to report any issues you may encounter.

Usage

Commands

Command Access Description
cstart [Bots] Master Starts the CS2 Interface
cstop [Bots] Master Stops the CS2 Interface
cstatus [Bots] Master Displays the status of the CS2 Interface

AutoStartCS2Interface

bool type with default value of false. This configuration setting can be added to your individual bot config files. If set to true, the CS2 Interface will automatically start after the bot comes online. When used, Paused should also be set to true.

"AutoStartCS2Interface": true,
"Paused": true,

Note It's not possible for a bot to farm non-CS2 cards and use the CS2 Interface at the same time. These two operations can interfere with one another on startup, and so it's important to also set Paused to true. This will prevent ASF's CardFarmer module from starting automatically.

If you want to farm cards you can still do so using the cstop or resume commands. The CS2 Interface will automatically resume after card farming is complete.


IPC Interface

Note Each bot can only process 1 request at a time.

Note Once the plugin is installed additional documentation can be found, by default, at: /swagger

API Method Parameters Description
/Api/CS2Interface/{botNames}/Start GET Starts the CS2 Interface
/Api/CS2Interface/{botNames}/Stop GET Stops the CS2 Interface
/Api/CS2Interface/{botNames}/InspectItem GET url, s, a, d, m, minimal, showDefs Inspect a CS2 Item 1
/Api/CS2Interface/{botNames}/PlayerProfile/{steamID} GET Get a CS2 player profile 1
/Api/CS2Interface/{botName}/Inventory GET minimal, showDefs Get the given bot's CS2 inventory
/Api/CS2Interface/{botName}/GetCrateContents/{crateID} GET minimal, showDefs Get the contents of the given bot's crate
/Api/CS2Interface/{botName}/StoreItem/{crateID}/{itemID} GET Stores an item into the specified crate
/Api/CS2Interface/{botName}/RetrieveItem/{crateID}/{itemID} GET Retrieves an item from the specified crate

Footnotes

  1. Responses are not dependent on the account used to make these requests. You may provide multiple botNames, and the first available bot will be used to make the request. 2