Automatically buys and sells tf2 items while listing on backpack.tf. The bot has the following features:
- automatically undercuts other sellers on backpack.tf and overcuts on buy orders
- automatically accepts offers and handles confirmations
- creates and removes listings on backpack.tf automatically
- maxstock
- auto-flips items (i.e. it sells an item immediately after it is bought)
- checks SR bans
- calculates profit and logs items sold
Begin by downloading the repository. You can do this by downloading as a zip. Make sure to keep everything in a single folder.
The next step is to install dependencies. To do this use
npm install
config.json is where login details are stored for the bot. The paramaters are as follows:
steamid
- the steamID64 of the bot, i.e. 765611xxxxxxxxxxadmin
- the steamID64 for the admin of the bot. Any trade the admin sends will be accepted, and the are certain chat commands to control the bot.hash
- the bots backpack.tf stack[hash] cookie. You can get this by logging into backpack.tf, and then viewing all cookies. Stack[hash] is needed so that we can find the ids of hidden listings, which are not viewable without being logged in. It is also the way heartbeats are sent (there are other alternatives, but this is much easier)token
- the bots backpack.tf tokenkey
- the bots backpack.tf API Key (THIS IS NOT THE SAME AS THE TOKEN)identity_secret
- the identity_secret for the bot. This is used to auto-accept confirmations.shared_secret
- the shared for the bot. Necessary for logins, because the bot periodically logs off and back on to reduce some errors, such as escrow days not being returned.username
- the bots steam login usernamepassword
- the bots steam login passwordname
- the display name of the bot. This is used so that the bot does not undercut itself.
Listings.json is the bread and butter of this program, and it controls which items are banked.
def_index
- the tf2 defindex of the item you want to bankquality
- the numeric quality ID for the item you want to bank. Currently only unique, strange, genuine, vintage, and haunted items are supported. I.e., 6= uniqueuncraft
- eithertrue
orfalse
, true if you want the uncraftable variant of the itemkillstreak
- either0
,-1
,2
,or3
. 0 accepts any killstreak, -1 is no killstreak. 1 is standard killstreak, 2 is specialized killstreak, 3 is professional killstreak.buyprice
- separated into key and ref paramaters, the price the bot buys the item at.sellprice
- same as buyprice except the sellprice.maxstock
- maximum stock for this item. After the stock is reached the listing will be removed from backpack.tfurl
- the url linking to the stats page of the item you want to bank. If you put this in wrong bad things will happen, as this is the url used in undercutting.listing_ids
where the bot stores the backpack.tf listing IDs for things.inventory
- the bot will put the item IDs that match the criteria in an array here automatically. You do not need to edit this.bought
- The bot automatically records the item IDs of items you have previously bought, and the price in keys in this parameter.sold
- Same as bought, except for item sales.
I have pre-included a list of around 1000 items that I previously hand-picked to bank.
run this BEFORE you run the bot with
node setup.js
This populates the inventory in listings.json, and sets all buy/sell IDs to null
The only thing you need to worry about in this file is keyvalue_bot, which is the keyprice in ref that you want to use.
This bot is designed to be used as a daemon with pm2. To install pm2, use
npm install pm2 -g
You can then run ./start.sh, which starts pm2 with a few settings I found to work well.
Only works for the admin. Send to the bot in steam chat
!trades
- tells you the #of trades accepted, received % acceptance rate (should be near 76% if everything is working), and profit in keys since you last checked.!tradesToday
- same as !trades but does not reset values when you check!resetTrades
- resets constant values on !tradesToday (for tracking percentages over longer times)!keyprice #
- i.e., !keyprice 37.66 to set the keyvalue in ref to 37.66. Will be saved to tradecount.json
- npm install
- npm install pm2 -g
- fix your config.json file.
- fix your listings.json file to have the listings you want
- fix tradecount to have the right key value
- node setup.js
- ./start.sh