From 494a094828dd0a1efc1fd0812498a038d268de17 Mon Sep 17 00:00:00 2001 From: Andrii Lavrenko Date: Thu, 19 Dec 2024 20:36:32 +0200 Subject: [PATCH] change logDOM string --- code.user.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/code.user.js b/code.user.js index dd6693b..d680a76 100644 --- a/code.user.js +++ b/code.user.js @@ -1294,14 +1294,6 @@ } } - function getAmountString(amount) { - if (amount == 1) { - return ''; - } - - return ` [x${amount}]`; - } - const sellQueue = async.queue( (task, next) => { market.sellItem( @@ -1321,7 +1313,8 @@ const callback = () => setTimeout(() => next(), getRandomInt(1000, 1500)); if (success) { - logDOM(`${padLeft} - ${itemName}${getAmountString(task.item.amount)} listed for ${formatPrice(market.getPriceIncludingFees(task.sellPrice) * task.item.amount)}, you will receive ${formatPrice(task.sellPrice * task.item.amount)}.`); + 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)}.`); $(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_SUCCESS); totalPriceWithoutFeesOnMarket += task.sellPrice * task.item.amount;