Skip to content

nguyenph88/ArchiSteamFarm-Randomize-Idling-Games

Repository files navigation

ASF Randomize Idling Games

Tl;dr: when using ASF to ille for trading card, there is an option to idle for playing time. However, this is a constant list. This small tool will help fetch the list of owned games from the user and the update the idle games periodically.

Automated tool to randomize Steam games for ArchiSteamFarm (ASF) idling. Fetches owned games, selects random ones, and updates bot configurations automatically.

Disclaimer: I created this tool for me to use only, and for education purpose. I'm not responsible for what happened to your account, nor I am affliated with ASF (i'm just building a tool on top of his ASF) - or Steam. Use at your own risk, source code is here for you to look at!

Features

  • 🔄 Automatic Steam ID resolution from profile URLs
  • 🎮 Fetch owned games via Steam Web API
  • 🎲 Random game selection with blacklist filtering
  • ⚙️ Bot config updates for ASF
  • Scheduled updates with configurable intervals
  • 🚫 Blacklist support for problematic games

Setup

1. Install Dependencies

pip install -r requirements.txt

2. Create .env File

Create a .env file in the project root:

STEAM_API_KEY="your_steam_api_key_here"
# Max games to farm (max 32)
MAX_GAMES_TO_FARM=30
# Update interval in minutes
UPDATE_INTERVAL=61
# Blacklist AppID that cannot be idled
BLACK_LIST_APPID=-11, -12

Required values:

  • STEAM_API_KEY: Your Steam Web API key from http://steamcommunity.com/dev/apikey
  • MAX_GAMES_TO_FARM: Number of random games to select (1-32)
  • UPDATE_INTERVAL: Minutes between updates (recommended: 61+)
  • BLACK_LIST_APPID: Comma-separated AppIDs to exclude

3. Create accounts.json File

Create an accounts.json file with your Steam accounts:

[
  {
    "url": "https://steamcommunity.com/id/your_username/",
    "steamID64": 0,
    "config": "bot1.json"
  },
  {
    "url": "https://steamcommunity.com/id/another_username",
    "steamID64": 0,
    "config": "bot2.json"
  }
]

Fields:

  • url: Steam profile URL (will be used to resolve Steam ID)
  • steamID64: Leave as 0 (will be auto-populated)
  • config: ASF bot configuration filename

4. Make sure everything is copied to the ASF folder.

So that the config/ folder will map to the config/ folder of ASF, inside there should be some of the json that you already had:

config/bot1.json:

{
  "GamesPlayedWhileIdle": [],
  "SteamLogin": "your_username",
  "SteamPassword": "your_password"
}

config/bot2.json:

{
  "GamesPlayedWhileIdle": [],
  "SteamLogin": "another_username", 
  "SteamPassword": "another_password"
}

Usage

Main Workflow (Recommended)

Run the complete automated workflow:

python MainOrchestrator.py

This will:

  1. 🔄 Update Steam IDs from profile URLs
  2. 🎮 Fetch owned games for all accounts
  3. 🎲 Select random games and update bot configs
  4. ⏰ Repeat every UPDATE_INTERVAL minutes

Individual Components

Update Steam IDs

python FindSteamID.py

Updates steamID64 fields in accounts.json from profile URLs.

Fetch Owned Games

python SteamAPI.py

Fetches owned games for all accounts and saves to config/<steam_id>_GamesOwned.json.

Extract Random Games

python ExtractAppID.py

Extracts random games from owned games data.

Update Bot Configs

python UpdateBotConfig.py

Updates bot configuration files with random game selections.

File Structure

ArchiSteamFarm-Randomize-Idling-Games/
├── .env                          # Environment variables
├── accounts.json                 # Steam account list
├── MainOrchestrator.py          # Main workflow orchestrator
├── FindSteamID.py               # Steam ID resolver
├── SteamAPI.py                  # Steam Web API client
├── ExtractAppID.py              # Game extraction utility
├── UpdateBotConfig.py           # Bot config updater
├── config/                      # Configuration folder
│   ├── bot1.json               # ASF bot 1 config
│   ├── bot2.json               # ASF bot 2 config
│   └── *_GamesOwned.json       # Owned games data
└── requirements.txt             # Python dependencies

Configuration

Environment Variables (.env)

Variable Description Default Required
STEAM_API_KEY Steam Web API key -
MAX_GAMES_TO_FARM Max games to select 32
UPDATE_INTERVAL Update interval (minutes) 61
BLACK_LIST_APPID AppIDs to exclude -

Steam API Key Setup

  1. Visit http://steamcommunity.com/dev/apikey
  2. Log in with your Steam account
  3. Enter a domain name (can be anything)
  4. Copy the generated API key
  5. Add to .env file

Troubleshooting

Common Issues

"STEAM_API_KEY not found"

  • Ensure .env file exists and contains STEAM_API_KEY

"Config file not found for Steam ID"

  • Check accounts.json has correct Steam IDs
  • Run FindSteamID.py to resolve Steam IDs

"Games owned file not found"

  • Run SteamAPI.py first to fetch owned games
  • Check Steam API key is valid

"Failed to extract games"

  • Verify Steam ID is correct
  • Check owned games file exists in config/ folder

Logs and Output

The program provides detailed status messages:

  • ✅ Success indicators
  • ❌ Error messages with details
  • ⏰ Countdown timers
  • 🔄 Progress updates

Integration with ASF

  1. Configure ASF to use the bot config files in config/
  2. Run MainOrchestrator.py to start automated updates
  3. ASF will automatically use the updated GamesPlayedWhileIdle settings

The bot configs are updated with random game selections, providing variety in idling games while respecting blacklists and limits.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages