An RTP calculator for Team Fortress 2 crate unbox sessions
npm install tf2-rtp-calculator
Usage: tf2-rtp-calculator [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 The amount of simulations per thread before emitting output (default: 256)
--offload Number of cores to offload to (default: -1, all cores) (default: -1)
-n, --crateName Name of crate to simulate
-i, --iterations Amount of iterations/unboxes to simulate
-d, --crateDataPath Path to the key-value JSON file of crates (default: "./data/crates.json")
-o, --outputPath Destination path for simulation output (default: ".")
-p, --priceDataPath Path or destination of item price data JSON (default: "./data/response.json")
-c, --currencyDataPath Path or destination of currency data JSON (default: "./data/currency.json")
-a, --apikey The API key for backpack.tf (env: BACKPACK_TF_API_KEY)
-h, --help display help for command
`
$3
1. Install the application from npm: npm install -g tf2-rtp-calculator
1. Create a .env file in the root directory with the following content:
`env
BACKPACK_TF_API_KEY=your_api_key_here
`
1. You can obtain an API key from backpack.tf
1. Run npm run install-data
1. Ensure the crate you wish to simulate is available in the ./data/crates.json file.
1. If it is not, you can add it manually in ./data/crate.json
1. The number values conform to enumerators defined in ./src/tf2/enums/*
1. Run the application with the desired mode and options.
1. For example, this will simulate unboxing 10,000 times for "Ghoulish Gains Case":
`bash
tf2-rtp-calculator simulate -n "Ghoulish Gains Crate" -i 10000
``