Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Configuration Guide

cwhelchel edited this page Apr 4, 2013 · 26 revisions

This guide will help you configuring your instance of SteamBot through the settings.json file. This file is located in the same place as the SteamBot.exe executable. A file named settings-template.json is available to use as a go-by.

Build SteamBot

See the Installation Guide for details on building the SteamBot project.

Configure the Bot

In order to run SteamBot you need to configure your bots propertly. This is done by creating a settings.json file located in the same place as the SteamBot executable or by renaming the settings-template.json.

The settings file is formatted using [JavaScript Object Notation (JSON)] (http://www.json.org) and must adhere to the syntactic structure of the language. Therefore it is advised to base your configuration off of the provided template file.

Here is a copy the template file. This guide will describe each configuration option in the following sections.

{
"Admins":["234567"],
"ApiKey":"Steam API Key goes here!",
"mainLog": "syslog.log",
"Bots": [
        {
            "Username":"BOT USERNAME",
            "Password":"BOT PASSWORD",
            "DisplayName":"TestBot",
            "ChatResponse":"Hi there bro",
            "logFile": "TestBot.log",
            "BotControlClass": "SteamBot.SimpleUserHandler",
            "MaximumTradeTime":180,
            "MaximumActionGap":30,
            "DisplayNamePrefix":"[AutomatedBot] ",
            "TradePollingInterval":800,
            "LogLevel":"Success"
        }
    ]
}

Main Configuration Options

These configuration options are global to the entire SteamBot application as opposed to the per-bot options in the next section.

Admins: An array of Steam Profile IDs (64 bit IDs) of the users that are an Admin of your bot(s). Each Profile ID should be a string in quotes and separated by a comma. These admins are global to all bots listed in the Bots array.

ApiKey: The API key you have been assigned by Valve. If you do not have one, it can be requested from Value at their Web API Key page. This is required and the bot(s) will not work without an API Key. The API Key should be a string in quotes.

mainLog: The log containing runtime information for all bots. This is independent of the logs for each Bot.

Bot Configuration Array

Bots: An array of JSON objects containing information about each individual bot you will be running. You can run multiple bots at the same time by having multiple elements in the Bots array. These entries must be separated by a comma.

Each entry in the Bots array consists of the following string-values pairs:

  • Username: REQUIRED The Steam user name for this bot. It should be a string in quotes.

  • Password: REQUIRED The password for the Steam user associated with this bot. It should be a string in quotes.

  • DisplayName: REQUIRED The name the bot will present on Steam. It should be a string in quotes.

  • ChatResponse: REQUIRED This is the response the bot will provide when a user chats with it via Steam Friends. It should be a string in quotes.

  • logFile: REQUIRED The log file for this specific bot. It should be a string in quotes.

  • BotControlClass: REQUIRED The fully qualified class name that controls how this specific bot will behave. It must be the fully qualified class (ie. SteamBot.SimpleUserHandler`). Generally, this type is in a separate file like [SimpleUserHandler.cs] (https://github.com/Jessecar96/SteamBot/blob/master/SteamBot/SimpleUserHandler.cs). It should be a string in quotes.

    Currently the SteamBot provides two default classes that can be used as a bot control class, SteamBot.SimpleUserHandler and SteamBot.AdminUserHandler. These classes can be extended or used as a basis for creating a new user handler class. See the next section for details on creating User Handlers.

  • Admins: Additional admins, specific to this bot. 64-bit Steam IDs (optional)

  • MaximumTradeTime: Maximum length of time for a trade session (in seconds). It should be a numeric value. Defaults to 180 seconds. (optional)

  • MaximumActionGap: Length of time the bot will allow the user to remain inactive. It should be a numeric value. Defaults to 30 seconds. (optional)

  • DisplayNamePrefix: A prefix to display in front of the DisplayName. It should be a string enclosed by quotes. Defaults to an empty string. (optional)

  • TradePollingInterval: Length of time, in milliseconds, between polling events. Higher values reduce CPU usage at the cost of a slower trading session. It should be a numeric value. Default is 800 ms. Lowest value is 100 ms. (optional)

  • LogLevel: Detail level of bot's log. In order from most verbose to least verbose, valid options are:

    • Debug: Information that is helpful in performing diagnostics.
    • Info: Generally useful information such as start/stop, polling events, etc. (default)
    • Success: Events that have completed in an expected manner.
    • Warn: Potential application problems, but which have been automatically handled.
    • Error: Event that prevents the bot from continuing to function without corrective action.
    • Interface: Events that require user interaction, such as entering a Steam Guard code to complete a login.
    • Nothing: A log level that suppresses all previous levels. (not recommended)

Step 2

  1. Next you need to actually edit the bot to make it do what you want.
  2. You can edit the files SimpleUserHandler.cs or AdminUserHandler.cs as they contains examples of most everything you need. Alternatively, you can subclass UserHandler and create your own class to control bot behavior. If you do this, remember to modify the BotControlClass setting in your configuration. Add your code to each of the events. Events are explained in code comments.
  3. Look at the section below to see some useful information if you intend to create your own UserHandler.

546

Clone this wiki locally