Skip to content

Citrinate/CS2Interface

Repository files navigation

Counter-Strike 2 Interface Plugin for ArchiSteamFarm

Check out my other ArchiSteamFarm plugins Help with translations GitHub all releases

Introduction

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

Projects that use this plugin

  • CS2Script, A userscript for managing your storage units and inspecting items

Installation

  • Download the .zip file from the latest release
  • Locate the plugins folder inside your ASF folder. Create a new folder here and unpack the downloaded .zip file to that 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
cs2interface Master Prints the current version of the plugin
cstart [Bots] [Minutes] Master Starts the CS2 Interface. Optinally, automatically stop the interface after Minutes of inactivity
cstop [Bots] Master Stops the CS2 Interface
cstatus [Bots] Master Displays the status of the CS2 Interface

Command Aliases

Command Alias
cstatus asf csa

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, FarmingPreferences should also have the FarmingPausedByDefault flag enabled.

"AutoStartCS2Interface": true,
"FarmingPreferences": 1,

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 enable the FarmingPausedByDefault flag. This will prevent ASF's CardFarmer module from starting automatically.

If you want to farm cards you can still do so using ASF's resume command, and the CS2 Interface will automatically resume when ASF stops farming. There are events however that will cause ASF to stop farming even if ASF isn't actually finished farming (such as when a new game is added to your bot's account). To guarantee that ASF fishishes farming cards you should use the cstop command, and then manually resume the interface when card farming is complete using the cstart command.


IPC Interface

Interface

API Method Parameters Description
/Api/CS2Interface/{botNames}/Start GET Starts the CS2 Interface
/Api/CS2Interface/{botNames}/Status GET Get the CS2 Interface status
/Api/CS2Interface/{botNames}/Stop GET Stops the CS2 Interface

Items

API Method Parameters Description
/Api/CS2Interface/{botName}/CraftItem/{recipeID} GET itemIDs Craft an item
/Api/CS2Interface/{botName}/GetCrateContents/{crateID} GET minimal, showDefs Get a storage unit's contents
/Api/CS2Interface/{botNames}/InspectItem GET url, s, a, d, m, minimal, showDefs Inspect an item
/Api/CS2Interface/{botName}/Inventory GET minimal, showDefs Get a bot's inventory
/Api/CS2Interface/{botName}/RetrieveItem/{crateID}/{itemID} GET Take an item out of a storage unit
/Api/CS2Interface/{botName}/StoreItem/{crateID}/{itemID} GET Place an item into a storage unit

Players

API Method Parameters Description
/Api/CS2Interface/{botName}/PlayerProfile/{steamID} GET Get a friend's player profile

Data

API Method Parameters Description
/Api/CS2Interface/Recipes GET showDefs Get a list of crafting recipes
/Api/CS2Interface/items_game.txt GET Get the contents of items_game.txt
/Api/CS2Interface/items_game_cdn.txt GET Get the contents of items_game_cdn.txt
/Api/CS2Interface/csgo_english.txt GET Get the contents of csgo_english.txt
/Api/CS2Interface/steam.inf GET Get the contents of steam.inf