';
// ---------- Automation ----------
str += m.Header('Automation');
// Auto trading
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerAutoTrading','CS_autoTrading','Auto Trading ON','Auto Trading OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerAutoTrading', false)
+ '
';
// Turns the entire stock market on or off.
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerMarketOn','CS_market','Stock Market ON','Stock Market OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerMarketOn', false)
+ '
';
// Auto-buy brokers
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerAutoBuyBrokers','CS_autoBuyBrokers','Auto-buy Brokers ON','Auto-buy Brokers OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerAutoBuyBrokers', false)
+ '
';
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerResourcesWarning','CS_resourcesWarning','Resources Warning ON','Resources Warning OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerResourcesWarning', false)
+ '
';
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerExponential','CS_Exponential','Exponential Warehouses ON','Exponential Warehouses OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerExponential', false)
+ '
';
// ---Exponential multiplier slider (CCSE helper, right-hand live value)
var cbWarehouseExponent = "stockerExponentialPower = (l('exponentSlider').value);"
+ " l('exponentSliderRightText').textContent = stockerExponentialPower;"
+ " CookiStocker.TradingStats();";
str += '
'
+ CCSE.MenuHelper.Slider(
'exponentSlider', 'Warehouse Exponent', ''+stockerExponentialPower+'', () => stockerExponentialPower, cbWarehouseExponent, 0.1, 3.0, 0.1
)
+ ' ' + CookiStocker.note('stockerExponentialPower', false)
+ '
';
// --- Min brokers slider (CCSE helper, right-hand live value)
var cbMinBrokers = "stockerMinBrokers = Math.round(l('minBrokersSlider').value);"
+ " l('minBrokersSliderRightText').textContent = stockerMinBrokers;"
+ " l('CS_commissionVal').textContent = CookiStocker.calcCommission(stockerMinBrokers);"
+ " CookiStocker.TradingStats();";
str += '
'
+ CCSE.MenuHelper.Slider(
'minBrokersSlider', 'Minimum Brokers', '', () => stockerMinBrokers, cbMinBrokers, 0, 162, 1
)
+ ' (Commission: '
+ CookiStocker.calcCommission(stockerMinBrokers)
+ ')'
+ CookiStocker.note('stockerMinBrokers', false)
+ '
';
// --- Bank percentage allowed per purchase (CCSE helper; shows %; stores fraction)
var stockerCookiesPercent = Math.round((stockerCookiesThreshold || 0) * 100);
var cbCookies = "var v = Math.round(l('cookiesPercentSlider').value);"
+ " stockerCookiesPercent = v;"
+ " stockerCookiesThreshold = v / 100;"
+ " l('cookiesPercentSliderRightText').textContent = v + '%';"
+ " CookiStocker.TradingStats();";
str += '
'
+ CCSE.MenuHelper.Slider('cookiesPercentSlider', 'Max Bank % per Purchase', '' + stockerCookiesPercent+'%', () => stockerCookiesPercent, cbCookies, 1, 100, 1)
+ ' ' + CookiStocker.note('stockerCookiesThreshold', false)
+ '
';
// ---------- Reporting & Notifications ----------
str += m.Header('Reporting & Notifications');
// Transaction notifs
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerTransactionNotifications','CS_txNotifs','TX Notifications ON','TX Notifications OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerTransactionNotifications', false)
+ '
';
// Fast notifs
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerFastNotifications','CS_fastNotifs','Fast Notifications ON','Fast Notifications OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerFastNotifications', false)
+ '
';
// Console announcements
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerConsoleAnnouncements','CS_console','Console Announce ON','Console Announce OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerConsoleAnnouncements', false)
+ '
';
// --- Activity report interval: mm:ss
var _arMin = Math.floor(stockerActivityReportFrequency / 60000);
var _arSec = Math.floor((stockerActivityReportFrequency % 60000) / 1000);
str += '
'
+ ' '
+ ' : '
+ ' '
+ 'mm:ss'
+ '
';
// Extra stats
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerAdditionalTradingStats','CS_moreStats','Extra Trading Stats ON','Extra Trading Stats OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerAdditionalTradingStats', false)
+ '
';
// ---------- Timing (Advanced) ----------
str += m.Header('Timing (Advanced)');
// Loop frequency (UI shows SECONDS; integers; right-justified ~5 digits)
str += '
'
+ ''
+ ''
+ CookiStocker.note('stockerLoopFrequency', true)
+ '
';
// Force loop (cheat)
str += '
'
+ m.ToggleButton(CookiStocker.state,'stockerForceLoopUpdates','CS_forceLoop','Force Loop (cheat) ON','Force Loop (cheat) OFF',"CookiStocker.Toggle")
+ CookiStocker.note('stockerForceLoopUpdates', true)
+ '
';
str += '
';
return str;
};
// ---------- Inline option comments (no tooltips) ----------
CookiStocker.esc = function(s){
return String(s).replace(/&/g,'&').replace(//g,'>')
.replace(/'/g,''').replace(/"/g,'"');
};
// Texts copied from the comments above your variable defs
CookiStocker.docs = {
stockerAutoTrading: "Automatic trading and broker buying when on",
stockerMarketOn: "Stock market is running when on",
stockerMinBrokers: "Minimum number of brokers required for automatic trading",
stockerCookiesThreshold: "Percentage of banked cookies allowed for a single automatic trade",
stockerAutoBuyBrokers: "Buy all necessary brokers as soon as we can afford them",
stockerResourcesWarning: "Display warning when market conditions and/or options do not permit auto trading",
stockerExponential: "Increases number of warehouses in sync with the highest raw CPS during this session",
stockerExponentialPower: "The ratio of the highest raw CPS to the original raw CPS is raised to this power when Exponential Warehouses is on",
stockerTransactionNotifications: "Announce transactions in game notifications",
stockerActivityReport: "Make regular profit reports",
stockerActivityReportFrequency: "How often to make regular reports (minutes and seconds)",
stockerFastNotifications: "Make game notifications fade away on their own after 6 seconds",
stockerConsoleAnnouncements: "Use console.log for more detailed info on prices and trends",
stockerAdditionalTradingStats: "Display more detailed trading info near the top of the stock market display",
stockerLoopFrequency: "Logic loop frequency (seconds) — CHEAT",
stockerForceLoopUpdates: "The cheat itself. Rolls the cycle every time logic loop triggers — CHEAT"
};
// Render end-of-line text (red if cheat)
CookiStocker.note = function(key, cheat){
const t = CookiStocker.esc(CookiStocker.docs[key] || "");
return t ? ('