Skip to content

Commit

Permalink
message improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
suddjian committed Oct 21, 2023
1 parent 0d97813 commit 2bac899
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/cookieclickermanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,11 @@ function adjustStockPortfolio() {
var analysis = analyzeStockMarket();
var { toBuy, toSell } = analysis;
toBuy.forEach(good => {
var $ = Beautify(good.val * good.stock);
var cookies = Beautify(Game.cookiesPsRawHighest * good.val * good.stock);
console.log(`%cCookie manager: buying ${good.symbol} at ${good.val} for $${$} (${cookies} 🍪)`, "color:sienna");
console.log(`%cCookie manager: buying ${getStockTradeStr(good)}`, "color:sienna");
clickOn(document.getElementById(good.l.id + "_Max"));
});
toSell.forEach(good => {
var $ = Beautify(good.val * good.stock);
var cookies = Beautify(Game.cookiesPsRawHighest * good.val * good.stock);
console.log(`%cCookie manager: selling ${good.symbol} at ${Beautify(good.val, 2)} for $${$} (${cookies} 🍪)`, "color:green");
console.log(`%cCookie manager: selling ${getStockTradeStr(good)}`, "color:green");
clickOn(document.getElementById(good.l.id + "_-All"));
});
}
Expand Down Expand Up @@ -181,6 +177,12 @@ 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} 🍪)`;
}

/*:・゚✧*:・゚✧ ----- GRIMOIRE ----- *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ *:・゚✧*:・゚✧ */

function handOfFateToBoostBuffs() {
Expand Down Expand Up @@ -247,6 +249,7 @@ window.cookieclickerhacks = {
getClickCps,
getProductCps,
getUpgradeCps,
getStockTradeStr,
adjustStockPortfolio,
analyzeStockMarket,
handOfFateToBoostBuffs,
Expand Down

0 comments on commit 2bac899

Please sign in to comment.