diff --git a/code.user.js b/code.user.js index 0e65810..4b544ec 100644 --- a/code.user.js +++ b/code.user.js @@ -196,6 +196,7 @@ const SETTING_MAX_MISC_PRICE = 'SETTING_MAX_MISC_PRICE'; const SETTING_PRICE_OFFSET = 'SETTING_PRICE_OFFSET'; const SETTING_PRICE_MIN_CHECK_PRICE = 'SETTING_PRICE_MIN_CHECK_PRICE'; + const SETTING_PRICE_MIN_LIST_PRICE = 'SETTING_PRICE_MIN_LIST_PRICE'; const SETTING_PRICE_ALGORITHM = 'SETTING_PRICE_ALGORITHM'; const SETTING_PRICE_IGNORE_LOWEST_Q = 'SETTING_PRICE_IGNORE_LOWEST_Q'; const SETTING_PRICE_HISTORY_HOURS = 'SETTING_PRICE_HISTORY_HOURS'; @@ -215,6 +216,7 @@ SETTING_MAX_MISC_PRICE: 10, SETTING_PRICE_OFFSET: 0.00, SETTING_PRICE_MIN_CHECK_PRICE: 0.00, + SETTING_PRICE_MIN_LIST_PRICE: 0.03, SETTING_PRICE_ALGORITHM: 1, SETTING_PRICE_IGNORE_LOWEST_Q: 1, SETTING_PRICE_HISTORY_HOURS: 12, @@ -1296,17 +1298,23 @@ const sellQueue = async.queue( (task, next) => { + totalNumberOfProcessedQueueItems++; + const digits = getNumberOfDigits(totalNumberOfQueuedItems); + const itemId = task.item.assetid || task.item.id; + const itemName = task.item.name || task.item.description.name; + const padLeft = `${padLeftZero(`${totalNumberOfProcessedQueueItems}`, digits)} / ${totalNumberOfQueuedItems}`; + + if (getSettingWithDefault(SETTING_PRICE_MIN_LIST_PRICE) * 100 >= market.getPriceIncludingFees(task.sellPrice)) { + logDOM(`${padLeft} - ${itemName} is not listed due to ignoring price settings.`); + $(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_PRICE_NOT_CHECKED); + next(); + + return; + } market.sellItem( task.item, task.sellPrice, (error, data) => { - totalNumberOfProcessedQueueItems++; - - const digits = getNumberOfDigits(totalNumberOfQueuedItems); - const itemId = task.item.assetid || task.item.id; - const itemName = task.item.name || task.item.description.name; - const padLeft = `${padLeftZero(`${totalNumberOfProcessedQueueItems}`, digits)} / ${totalNumberOfQueuedItems}`; - const success = Boolean(data?.success); const message = data?.message || ''; @@ -3807,6 +3815,10 @@ Don't check market listings with prices of and below: +