Skip to content

Commit

Permalink
add deals and stock
Browse files Browse the repository at this point in the history
  • Loading branch information
offish committed Mar 9, 2024
1 parent ab769e5 commit 52afd6c
Show file tree
Hide file tree
Showing 28 changed files with 15,127 additions and 167 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203, E704, Q000
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2023 offish
Copyright (c) 2020-2024 offish

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
55 changes: 34 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,24 @@ Donations are not required, but greatly appericated.


## Features
* GUI for adding and changing items, prices, `max_stock` + browsing trades
* Automated item # by [Prices.TF](https://prices.tf)
* GUI for adding items, changing prices and browsing trades
* Bank as many items as you want
* Add items by name or SKU
* Add items by either name or SKU
* Uses MongoDB for saving items, prices and trades
* Supports Random Craft Hats [[?]](#random-craft-hats)
* Run multiple bots at once, each with their own database
* Keeps track of item stock and checks if trades surpass their related item's `max_stock`
* Fetches the bot's inventory once, and keeps track of items using receipts
* Supports SKU item formats for ease of use
* Supports 3rd party inventory providers [[?]](#3rd-party-inventory-providers)
* Supports 3rd party emitted "deals" [[?]](#3rd-party-deals)
* Utilizes [tf2-sku](https://github.com/offish/tf2-sku)
* Utilizes [tf2-data](https://github.com/offish/tf2-data)
* Utilizes [tf2-utils](https://github.com/offish/tf2-utils)

Available options can be found [here](express/options.py).

*Backpack.tf listing is not supported yet.*

## Showcase
Expand All @@ -37,14 +42,23 @@ Donations are not required, but greatly appericated.
## Installation
Full installation guide can be found on the [wiki](https://github.com/offish/tf2-express/wiki).

If MongoDB is already installed, it should be fairly straight forward.
If MongoDB is already installed, installation should be fairly straight forward.

```bash
git clone git@github.com:offish/tf2-express.git
cd tf2-express
pip install -r requirements.txt
```

## Updating
```bash
# tf2-express/
git pull
pip install --upgrade -r requirements.txt
# update packages like tf2-utils, tf2-data and tf2-sku,
# which the bot is dependant on
```

## Setup
Rename `config.example.json` to `config.json`. Update credentials and set your preferred `options`.

Expand All @@ -53,6 +67,7 @@ Example config:
{
"name": "nickname",
"check_versions_on_startup": true,
"listen_to_pricer": true,
"bots": [
{
"name": "bot1",
Expand All @@ -65,13 +80,19 @@ Example config:
"identity_secret": "aA11aaaa/aa11a/aAAa1a1="
},
"options": {
"enable_deals": false,
"inventory_provider": "steamcommunity or steamsupply or steamapis",
"inventory_api_key": "inventory api key or empty",
"fetch_prices_on_startup": true,
"accept_donations": true,
"decline_bad_offers": false,
"decline_trade_hold": true,
"decline_scam_offers": true,
"allow_craft_hats": true,
"allow_craft_hats": false,
"save_trades": true,
"save_receipt": true,
"poll_interval": 30,
"database": "mydatabasename",
"owners": [
"76511111111111111",
"76522222222222222"
Expand All @@ -90,10 +111,7 @@ Example config:
},
"options": {
"accept_donations": true,
"decline_bad_offers": false,
"decline_trade_hold": false,
"decline_scam_offers": false,
"allow_craft_hats": false,
"allow_craft_hats": true,
"save_trades": true,
"poll_interval": 60,
"database": "bot2database"
Expand All @@ -119,14 +137,6 @@ Level is set to DEBUG, so here you will be able to see every request etc. and mo

*Do NOT share this log file with anyone else before removing sensitive information. This will leak your `API_KEY` and more.*

## Updating
```bash
# tf2-express/
git pull
pip install --upgrade -r requirements.txt
# update packages like tf2-utils, tf2-data and tf2-sku,
# which the bot is dependant on
```

## Explanation
### Random Craft Hats
Expand All @@ -137,22 +147,25 @@ If a craftable hat does not have a specific price in the database, it will be vi
Simply open the GUI and add "Random Craft Hat" to the pricelist. Set the buy and sell price to whatever you want. This item cannot get automatic price updates.

### 3rd Party Inventory Providers
Avoid Steam's inventory rate-limits by using a third party provider like SteamApis, Steam.supply or your own.
Avoid Steam's inventory rate-limits by using a third party provider like SteamApis, Steam.Supply or your own.


### 3rd Party Deals
"Deals" in this context are data which is emitted by third party using a TCP socket. This data will be acted on, such as sending an offer using the included trade URL and price. They are named "deals" as I've been using it for arbitrage purposes.


## Testing
```bash
# tf2-express/
python -m unittest
```

## Todo
- [ ] Add stock limits (in stock/max stock)
- [ ] Add BackpackTF listing
All of the tests should output OK, except for the version check. They should be equal.

## License
MIT License

Copyright (c) 2020-2023 offish
Copyright (c) 2020-2024 offish ([confern](https://steamcommunity.com/id/confern))

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion express/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__title__ = "tf2-express"
__author__ = "offish"
__license__ = "MIT"
__version__ = "2.0.4"
__version__ = "2.1.0"
12 changes: 7 additions & 5 deletions express/config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@
"identity_secret": "aA11aaaa/aa11a/aAAa1a1="
},
"options": {
"enable_deals": false,
"inventory_provider": "steamcommunity or steamsupply or steamapis",
"inventory_api_key": "inventory api key or empty",
"fetch_prices_on_startup": true,
"accept_donations": true,
"decline_bad_offers": false,
"decline_trade_hold": true,
"decline_scam_offers": true,
"allow_craft_hats": true,
"allow_craft_hats": false,
"save_trades": true,
"save_receipt": true,
"poll_interval": 30,
"database": "mydatabasename",
"owners": [
"76511111111111111",
"76522222222222222"
Expand All @@ -40,10 +45,7 @@
},
"options": {
"accept_donations": true,
"decline_bad_offers": false,
"decline_trade_hold": false,
"decline_scam_offers": false,
"allow_craft_hats": false,
"allow_craft_hats": true,
"save_trades": true,
"poll_interval": 60,
"database": "bot2database"
Expand Down
Loading

0 comments on commit 52afd6c

Please # to comment.