ValveExe

class valveexe.ValveExe(gameExe, gameDir, steamExe=None, appid=None)[source]
__init__(gameExe, gameDir, steamExe=None, appid=None)[source]

Defines a launchable source engine game to be interacted with.

Note

Some games cannot be launched by their .exe alone (ex:csgo, probably for anti-cheat related reasons). Those games need to include the optional parameters steamExe and appid. Those parameters are only to be used if absolutely needed, they are a fallback and will downgrade ValveEXE functionnality if present.

Parameters:
  • gameExe (path, str) – the path for the game executable.

  • gameDir (path, str) – The mod directory.

  • steamExe (optional, path, str) – The path for the Steam executable.

  • appid (optional, int) – The Steam AppID.

launch(*params)[source]

Launches the game as specified in __init__ with the launch parameters supplied as arguments.

Parameters:

*params (str) – The launch parameters to be supplied to the executable.

run(command, *params)[source]

Forwards a command with its parameters to the active VConsole

Parameters:
  • command (str) – A Source Engine console command.

  • *params (str) – The values to be included with the command.

quit()[source]

Closes the game client