From a1374f557925010e8445484c6599ff2329dd583b Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Tue, 5 Nov 2024 01:55:28 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=9A=AE=20remove=20unnecessary=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Bot.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index 0861428c2..df4f5ec4a 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -634,10 +634,6 @@ export default class Bot { if (this.options.normalize.strangeAsSecondQuality.our && listingSKU.includes(';strange')) { listingSKU = listingSKU.replace(';strange', ''); } - } else { - if (/;[p][0-9]+/.test(listingSKU)) { - listingSKU = listingSKU.replace(/;[p][0-9]+/, ''); - } } let match: Entry | null; From ec41b9e9a4138e2aa2ae863445d0d9a97861e334 Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Tue, 5 Nov 2024 01:58:44 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=A8=20fix=20sell=20listings=20diss?= =?UTF-8?q?appearing=20after=20auto-check=20for=20missing=20listings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Bot.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index df4f5ec4a..cf4c737cd 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -685,8 +685,6 @@ export default class Bot { if ( _listings.length === 1 && listing.intent === 0 && // We only check if the only listing exist is buy order - entry.max > 1 && - amountAvailable > 0 && amountAvailable > entry.min ) { // here we only check if the bot already have that item From 92600b2088680a4d19238fa31e121b6a94c6a308 Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Tue, 5 Nov 2024 02:06:49 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=A8=20here=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Commands/sub-classes/Manager.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/classes/Commands/sub-classes/Manager.ts b/src/classes/Commands/sub-classes/Manager.ts index 1d58e3522..4ba80cac3 100644 --- a/src/classes/Commands/sub-classes/Manager.ts +++ b/src/classes/Commands/sub-classes/Manager.ts @@ -617,10 +617,6 @@ export default class ManagerCommands { if (opt.normalize.strangeAsSecondQuality.our && listingSKU.includes(';strange')) { listingSKU = listingSKU.replace(';strange', ''); } - } else { - if (/;[p][0-9]+/.test(listingSKU)) { - listingSKU = listingSKU.replace(/;[p][0-9]+/, ''); - } } const match = this.bot.pricelist.getPrice({ priceKey: listingSKU }); @@ -668,8 +664,6 @@ export default class ManagerCommands { if ( _listings.length === 1 && listing.intent === 0 && // We only check if the only listing exist is buy order - entry.max > 1 && - amountAvailable > 0 && amountAvailable > entry.min ) { // here we only check if the bot already have that item From d0be169d86a3dc9b3cdfd5e82b53f7af74f811c6 Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Tue, 5 Nov 2024 02:08:44 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=84=EF=B8=8F=20re-enable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Bot.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index cf4c737cd..a67f95ef6 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -570,7 +570,6 @@ export default class Bot { } startAutoRefreshListings(): void { - return; // Automatically check for missing listings every 30 minutes let pricelistLength = 0; From 6aee118627c60eaea282d2c5c8f833e3ddaa1d5a Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Tue, 5 Nov 2024 02:27:35 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=A8=20fix=20some=20inconsistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Commands/sub-classes/Manager.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/classes/Commands/sub-classes/Manager.ts b/src/classes/Commands/sub-classes/Manager.ts index 4ba80cac3..6e901741b 100644 --- a/src/classes/Commands/sub-classes/Manager.ts +++ b/src/classes/Commands/sub-classes/Manager.ts @@ -18,6 +18,7 @@ import log from '../../../lib/logger'; import { pure, testPriceKey } from '../../../lib/tools/export'; import filterAxiosError from '@tf2autobot/filter-axios-error'; import { AxiosError } from 'axios'; +import { Entry } from '../../Pricelist'; // Bot manager commands @@ -619,7 +620,13 @@ export default class ManagerCommands { } } - const match = this.bot.pricelist.getPrice({ priceKey: listingSKU }); + let match: Entry | null; + const assetIdPrice = this.bot.pricelist.getPrice({ priceKey: listing.id.slice('440_'.length) }); + if (null !== assetIdPrice) { + match = assetIdPrice; + } else { + match = this.bot.pricelist.getPrice({ priceKey: listingSKU }); + } if (isFilterCantAfford && listing.intent === 0 && match !== null) { const canAffordToBuy = inventoryManager.isCanAffordToBuy(match.buy, inventory); @@ -708,8 +715,8 @@ export default class ManagerCommands { } } - const skusToCheck = Object.keys(pricelist); - const pricelistCount = skusToCheck.length; + const priceKeysToCheck = Object.keys(pricelist); + const pricelistCount = priceKeysToCheck.length; if (pricelistCount > 0) { clearTimeout(this.executeRefreshListTimeout); @@ -718,7 +725,7 @@ export default class ManagerCommands { log.debug( 'Checking listings for ' + pluralize('item', pricelistCount, true) + - ` [${skusToCheck.join(', ')}] ...` + ` [${priceKeysToCheck.join(', ')}] ...` ); this.bot.sendMessage( @@ -738,7 +745,7 @@ export default class ManagerCommands { }, (this.pricelistCount > 4000 ? 60 : 30) * 60 * 1000); await this.bot.listings.recursiveCheckPricelist( - skusToCheck, + priceKeysToCheck, pricelist, true, this.pricelistCount > 4000 ? 400 : 200,