tf2-rtp-calculator
v1.1.0
Published
An RTP calculator for Team Fortress 2 crate unbox sessions
Maintainers
Readme
tf2-rtp-calculator
A command-line application for simulating mass unboxing in Team Fortress 2 for the purposes of approximating RTP (return-to-player) and other related data.
Usage
Command-Line Interface
Usage: tf2-rtp-calculator <mode> [options]
Calculates the RTP of TF2 crates and unusuals
Arguments:
mode (`install` or `simulate`)
Options:
-v, --verbose Enables additional logging
-u, --update Same as --install, but also updates the data if it is older than 24hrs
-b, --batchSize <amount> The amount of simulations per thread before emitting output (default: 256)
--offload <amount> Number of cores to offload to (default: -1, all cores) (default: -1)
-n, --crateName <string> Name of crate to simulate
-i, --iterations <amount> Amount of iterations/unboxes to simulate
-d, --crateDataPath <dir> Path to the key-value JSON file of crates (default: "./data/crates.json")
-o, --outputPath <dir> Destination path for simulation output (default: ".")
-p, --priceDataPath <dir> Path or destination of item price data JSON (default: "./data/response.json")
-c, --currencyDataPath <dir> Path or destination of currency data JSON (default: "./data/currency.json")
-a, --apikey <key> The API key for backpack.tf (env: BACKPACK_TF_API_KEY)
-h, --help display help for commandStep-By-Step Guide
- Install the application from npm:
npm install -g tf2-rtp-calculator - Create a
.envfile in the root directory with the following content:BACKPACK_TF_API_KEY=your_api_key_here- You can obtain an API key from backpack.tf
- Run
npm run install-data - Ensure the crate you wish to simulate is available in the
./data/crates.jsonfile.- If it is not, you can add it manually in
./data/crate.json - The number values conform to enumerators defined in
./src/tf2/enums/*
- If it is not, you can add it manually in
- Run the application with the desired mode and options.
- For example, this will simulate unboxing 10,000 times for "Ghoulish Gains Case":
tf2-rtp-calculator simulate -n "Ghoulish Gains Crate" -i 10000
- For example, this will simulate unboxing 10,000 times for "Ghoulish Gains Case":
