Skip to content

Commit

Permalink
fix Autokeys not buying keys when refs >= maxRef
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed Jul 16, 2020
1 parent ce10183 commit ca7eab7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,23 @@ If you want to use this feature, you must use [ecosystem.template.json](https://
This feature when enabled, your bot will automatically buy or sell keys based on your bot pure availability and your settings on this feature. You'll need to set your minimum/maximum keys and minimum/maximum refined metals in your ecosystem.json - more explaination can be found [here](https://github.com/idinium96/tf2autobot#your-bot-settings) starting on `ENABLE_AUTO_SELL_AND_BUY_KEYS` until `MAXIMUM_REFINED_TO_STOP_SELL_KEYS`.

```
.____________________________________________________________. ._______________________________.
| **Buying Keys** | **Selling Keys** | | **Banking Keys** |
| *************** | **************** | | **************** |
| <—————————————○ | ○——————————————> | | ○——————————————> |
| Keys -----|--------|-----> | Keys -----|--------|-----> | | Keys -----|--------|-----> |
| ○—————> | <————○ | | ○————————○ |
| Refs -----|--------|-----> | Refs -----|--------|-----> | | Refs -----|--------|-----> |
| min max | min max | | min max |
|_____________________________|______________________________| |______________________________.|
| **Disabled** | | **Disabled** |
| ************ | | ************ |
| <····●········●·····> | | <————● |
| Keys -----|--------|-----> | | Keys -----|--------|-----> |
| ●————————●·····> | | <—————————————● |
| Refs -----|--------|-----> | | Refs -----|--------|-----> |
| min max | | min max |
|_____________________________| |_______________________________|
.____________________________________________________________. ._______________________________.
| **Buying Keys** | **Selling Keys** | | **Banking Keys** |
| *************** | **************** | | **************** |
| <———————————○ | ○————————————> | | ○————————————> |
| Keys -----|--------|-----> | Keys -----|--------|-----> | | Keys -----|--------|-----> |_______________________________.
| ○———> | <——○ | | ○————————○ | **Disabled** |
| Refs -----|--------|-----> | Refs -----|--------|-----> | | Refs -----|--------|-----> | ************ |
| min max | min max | | min max | <——● |
|_____________________________|______________________________| |______________________________.| Keys -----|--------|-----> |
| **Disabled** | | **Buying when more ref** | <———————————● |
| ************ | | ************ | Refs -----|--------|-----> |
| <——●————————●···> | | <——● | min max |
| Keys -----|--------|-----> | | Keys -----|--------|-----> |_______________________________|
| ●————————●···> | | ————————————> |
| Refs -----|--------|-----> | | Refs -----|--------|-----> |
| min max | | min max |
|_____________________________| |_______________________________|
```

Some screenshots:
Expand Down
10 changes: 4 additions & 6 deletions src/classes/MyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1394,13 +1394,11 @@ export = class MyHandler extends Handler {
* (currKeys ≤ minKeys OR minKeys ≤ currKeys ≤ maxKeys OR currKeys ≥ maxKeys)
*/
const isRemoveAutoKeys =
(((currReftoScrap >= userMinReftoScrap && currReftoScrap <= userMaxReftoScrap) ||
currReftoScrap >= userMaxReftoScrap) &&
(currKeys <= userMinKeys ||
(currKeys >= userMinKeys && currKeys <= userMaxKeys) ||
currKeys >= userMaxKeys)) !== false;
(currReftoScrap >= userMaxReftoScrap && currKeys >= userMaxKeys) ||
(currReftoScrap >= userMinReftoScrap && currReftoScrap <= userMaxReftoScrap && currKeys <= userMaxKeys) !==
false;
/*
// <·····●····························●·····> \
// <——————————————————————————————————●·····> \
// Keys --------|----------------------------|----------> ⟩ AND
// ●————————————————————————————●·····> /
// Refs --------|----------------------------|---------->
Expand Down

0 comments on commit ca7eab7

Please sign in to comment.