Skip to content

Commit

Permalink
fix stock buy logging
Browse files Browse the repository at this point in the history
  • Loading branch information
suddjian committed Oct 21, 2023
1 parent 2bac899 commit ad957ce
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/cookieclickermanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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 ----- *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ */
Expand Down

0 comments on commit ad957ce

Please sign in to comment.