Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SeRi0uS007 committed Dec 21, 2024
1 parent e487a0f commit b4054f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1303,10 +1303,11 @@
const digits = getNumberOfDigits(totalNumberOfQueuedItems);
const itemId = task.item.assetid || task.item.id;
const itemName = task.item.name || task.item.description.name;
const itemNameWithAmount = task.item.amount == 1 ? itemName : `${task.item.amount}x ${itemName}`;
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.`);
logDOM(`${padLeft} - ${itemNameWithAmount} is not listed due to ignoring price settings.`);
$(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_PRICE_NOT_CHECKED);
next();
return;
Expand All @@ -1322,8 +1323,7 @@
const callback = () => setTimeout(() => next(), getRandomInt(1000, 1500));

if (success) {
const amount = task.item.amount == 1 ? '' : `${task.item.amount}x `;
logDOM(`${padLeft} - ${amount}${itemName} listed for ${formatPrice(market.getPriceIncludingFees(task.sellPrice) * task.item.amount)}, you will receive ${formatPrice(task.sellPrice * task.item.amount)}.`);
logDOM(`${padLeft} - ${itemNameWithAmount} listed for ${formatPrice(market.getPriceIncludingFees(task.sellPrice) * task.item.amount)}, you will receive ${formatPrice(task.sellPrice * task.item.amount)}.`);
$(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_SUCCESS);

totalPriceWithoutFeesOnMarket += task.sellPrice * task.item.amount;
Expand All @@ -1336,7 +1336,7 @@
}

if (message && isRetryMessage(message)) {
logDOM(`${padLeft} - ${itemName} retrying listing because: ${message.charAt(0).toLowerCase()}${message.slice(1)}`);
logDOM(`${padLeft} - ${itemNameWithAmount} retrying listing because: ${message.charAt(0).toLowerCase()}${message.slice(1)}`);

totalNumberOfProcessedQueueItems--;
sellQueue.unshift(task);
Expand All @@ -1348,7 +1348,7 @@
return;
}

logDOM(`${padLeft} - ${itemName} not added to market${message ? ` because: ${message.charAt(0).toLowerCase()}${message.slice(1)}` : '.'}`);
logDOM(`${padLeft} - ${itemNameWithAmount} not added to market${message ? ` because: ${message.charAt(0).toLowerCase()}${message.slice(1)}` : '.'}`);
$(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_ERROR);

callback();
Expand Down

0 comments on commit b4054f3

Please sign in to comment.