From ad957ce3cb266c749e5616fd5ce06d255d018e93 Mon Sep 17 00:00:00 2001 From: suddjian Date: Fri, 20 Oct 2023 20:16:37 -0700 Subject: [PATCH] fix stock buy logging --- src/cookieclickermanager.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cookieclickermanager.js b/src/cookieclickermanager.js index 2e884e5..f26a515 100644 --- a/src/cookieclickermanager.js +++ b/src/cookieclickermanager.js @@ -131,7 +131,8 @@ function adjustStockPortfolio() { var analysis = analyzeStockMarket(); var { toBuy, toSell } = analysis; toBuy.forEach(good => { - console.log(`%cCookie manager: buying ${getStockTradeStr(good)}`, "color:sienna"); + var stockTradeStr = getStockTradeStr(good, StockMarket.getGoodMaxStock(good)); + console.log(`%cCookie manager: buying ${stockTradeStr}`, "color:sienna"); clickOn(document.getElementById(good.l.id + "_Max")); }); toSell.forEach(good => { @@ -177,10 +178,10 @@ function analyzeStockMarket(buyPercentile=0.1, sellPercentile=0.3) { }; } -function getStockTradeStr(good) { - var $ = Beautify(good.val * good.stock); - var cookies = Beautify(Game.cookiesPsRawHighest * good.val * good.stock); - return `${Beautify(good.stock)} ${good.symbol} at $${Beautify(good.val, 2)} for $${$} (${cookies} 🍪)`; +function getStockTradeStr(good, amount) { + var $ = Beautify(good.val * amount); + var cookies = Beautify(Game.cookiesPsRawHighest * good.val * amount); + return `${Beautify(amount)} ${good.symbol} at $${Beautify(good.val, 2)} for $${$} (${cookies} 🍪)`; } /*:・゚✧*:・゚✧ ----- GRIMOIRE ----- *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ */