if (autoTrimpSettings === undefined) { console.log('Huh, autoTrimpSettings was undefined in the UI script...') var autoTrimpSettings = new Object(); } automationMenuInit(); //Booleans createSetting('ManualGather', 'Auto Gather', 'Will automatically gather resources and build.', 'boolean'); createSetting('AutoFight', 'Better Auto Fight', 'Will automatically handle fighting.', 'boolean'); createSetting('AutoStance', 'Auto Stance', 'Automatically swap stances to avoid death.', 'boolean'); createSetting('TrapTrimps', 'Trap Trimps', 'Automatically trap trimps when needed, including building traps.', 'boolean'); createSetting('BuyStorage', 'Buy Storage', 'Will buy storage when resource is almost full', 'boolean'); createSetting('BuyJobs', 'Buy Jobs', 'Buys jobs based on ratios configured', 'boolean'); createSetting('BuyBuildings', 'Buy Buildings', 'Will buy non storage buildings as soon as they are available', 'boolean'); createSetting('BuyUpgrades', 'Buy Upgrades', 'Autobuy non eqipment Upgrades', 'boolean'); createSetting('BuyArmor', 'Buy Armor', 'Will buy the most efficient armor available', 'boolean'); createSetting('BuyArmorUpgrades', 'Buy Armor Upgrades', 'Will buy the most efficient armor upgrade available', 'boolean'); createSetting('BuyWeapons', 'Buy Weapons', 'Will buy the most efficient weapon available', 'boolean'); createSetting('BuyWeaponUpgrades', 'Buy Weapon Upgrades', 'Will buy the most efficient weapon upgrade available', 'boolean'); createSetting('BuyShieldblock', 'Buy Shield Block', 'Will buy the shield block upgrade. If you are progressing past zone 60, you probably don\'t want this', 'boolean'); createSetting('RunMapsWhenStuck', 'Auto Maps', 'Automatically run maps to progress', 'boolean'); createSetting('RunUniqueMaps', 'Run Unique Maps', 'Auto run unique maps. Required for autoPortal Electricity and Crushed modes.', 'boolean'); createSetting('HireScientists', 'Hire Scientists', 'Enable or disable hiring of scientists.', 'boolean'); createSetting('EasyMode', 'Easy Mode', 'Automatically changes settings based on current progress. Just worker ratios right now. WARNING: overrides worker ratio settings.', 'boolean'); createSetting('ManageBreedtimer', 'Manage Breed Timer', 'Automatically manage the breed timer. Picks appropriate timers for various challenges. Delays purchasing potency and nurseries if trying to raise the timer. EFFECTIVELY LOCKS THE BREED TIMER', 'boolean'); // createSetting('', '', '', 'boolean'); //Values createSetting('GeneticistTimer', 'Geneticist Timer', 'Breed time in seconds to shoot for using geneticists. CANNOT CHANGE WITH MANAGE BREED TIMER OPTION ON', 'value', '30'); createSetting('FarmerRatio', 'Farmer Ratio', '', 'value', '1'); createSetting('LumberjackRatio', 'Lumberjack Ratio', '', 'value', '1'); createSetting('MinerRatio', 'Miner Ratio', '', 'value', '1'); createSetting('MaxExplorers', 'Max Explorers', 'Map the planet!!', 'value', '150'); createSetting('MaxTrainers', 'Max Trainers', 'Fist bump me bro', 'value', -1); createSetting('MaxHut', 'Max Huts', '', 'value', '50'); createSetting('MaxHouse', 'Max Houses', '', 'value', '50'); createSetting('MaxMansion', 'Max Mansions', '', 'value', '50'); createSetting('MaxHotel', 'Max Hotels', '', 'value', '50'); createSetting('MaxResort', 'Max Resorts', '', 'value', '50'); createSetting('MaxGateway', 'Max Gateways', 'WARNING: Not recommended to raise above 25', 'value', '25'); createSetting('MaxWormhole', 'Max Wormholes', 'WARNING: Wormholes cost helium! Values below 0 do nothing.', 'value', '0'); createSetting('MaxCollector', 'Max Collectors', '', 'value', '-1'); createSetting('FirstGigastation', 'First Gigastation', 'How many warpstations to buy before your first gigastation', 'value', '20'); createSetting('DeltaGigastation', 'Delta Gigastation', 'How many extra warpstations to buy for each gigastation. Supports fractional values. For example 2.5 will buy +2/+3/+2/+3...', 'value', '2'); createSetting('MaxGym', 'Max Gyms', '', 'value', '-1'); createSetting('MaxTribute', 'Max Tributes', '', 'value', '-1'); createSetting('MaxNursery', 'Max Nurseries', '', 'value', '-1'); createSetting('VoidMaps', 'Void Maps', 'The zone at which you want all your void maps to be cleared. 0 is off', 'value', '0'); // createSetting('', '', '', 'value', '30'); //Dropdown + context sensitive createSetting('Prestige', 'Prestige', 'Acquire prestiges through the selected item (inclusive) as soon as they are available in maps. Forces equip first mode. Automap must be enabled.', 'dropdown', 'Off', ['Off', 'Supershield', 'Dagadder', 'Bootboost', 'Megamace', 'Hellishmet', 'Polierarm', 'Pantastic', 'Axeidic', 'Smoldershoulder', 'Greatersword', 'Bestplate', 'Harmbalest', 'GambesOP']); createSetting('AutoPortal', 'Auto Portal', 'Automatically portal', 'dropdown', 'Off', ['Off', 'Helium Per Hour', 'Balance', 'Electricity', 'Crushed', 'Nom', 'Toxicity', 'Custom']); createSetting('HeliumHourChallenge', 'Challenge for Helium per Hour', 'Automatically portal with this challenge when using helium per hour autoportal.', 'dropdown', 'None', ['None', 'Balance', 'Electricity', 'Crushed', 'Nom', 'Toxicity']); createSetting('CustomAutoPortal', 'Custom Portal', 'Automatically portal after clearing this level', 'value', '20'); //advanced settings var advHeader = document.createElement("DIV"); var advBtn = document.createElement("DIV"); advBtn.setAttribute('class', 'btn btn-default'); advBtn.setAttribute('onclick', 'autoToggle(document.getElementById(\'advancedSettings\'))'); advBtn.innerHTML = 'Advanced Settings'; advBtn.setAttribute("onmouseover", 'tooltip(\"Advanced Settings\", \"customText\", event, \"Leave off unless you know what you\'re doing with them.\")'); advBtn.setAttribute("onmouseout", 'tooltip("hide")'); advBtn.setAttribute('style', 'margin-left: 1vw; margin-right: 1vw; margin-bottom: 1vw;'); advHeader.appendChild(advBtn); document.getElementById("autoSettings").appendChild(advHeader); var adv = document.createElement("DIV"); adv.id = 'advancedSettings'; adv.style.display = 'none'; document.getElementById("autoSettings").appendChild(adv); //advanced settings createSetting('LimitEquipment', 'Limit Equipment', 'Limit levels of equipment bought to 11-prestige level. WARNING: may reduce He/hr performance in many cases.', 'boolean', null, null, 'advancedSettings'); createSetting('BreedFire', 'Breed Fire', 'Fire Lumberjacks and Miners to speed up breeding when needed', 'boolean', null, null, 'advancedSettings'); createSetting('MaxTox', 'Max Toxicity Stacks', 'Get maximum toxicity stacks before killing the improbability in each zone 60 and above. Generally only recommended for 1 run to maximize bone portal value.', 'boolean', null, null, 'advancedSettings'); createSetting('RunNewVoids', 'Run New Voids', 'Run new void maps acquired after the set void map zone.', 'boolean', null, null, 'advancedSettings'); createSetting('VoidCheck', 'Void Difficulty Check', 'How many hits to be able to take from a void map boss in dominance stance before we attempt the map. Higher values will get you stronger before attempting.', 'value', '2', null, 'advancedSettings'); function automationMenuInit() { var settingBtnSrch = document.getElementsByClassName("btn btn-default"); for (var i = 0; i < settingBtnSrch.length; i++) { if (settingBtnSrch[i].getAttribute("onclick") === "toggleSettingsMenu()") settingBtnSrch[i].setAttribute("onclick", "autoPlusSettingsMenu()"); } //create the button Automation button var newItem = document.createElement("TD"); newItem.appendChild(document.createTextNode("Automation")); newItem.setAttribute("class", "btn btn-default"); newItem.setAttribute("onclick", "autoToggle()"); var settingbarRow = document.getElementById("settingsTable").firstElementChild.firstElementChild; settingbarRow.insertBefore(newItem, settingbarRow.childNodes[10]); //create automaps button var newContainer = document.createElement("DIV"); newContainer.setAttribute("class", "battleSideBtnContainer"); newContainer.setAttribute("style", "display: block;"); newContainer.setAttribute("id", "autoMapBtnContainer"); var abutton = document.createElement("SPAN"); abutton.appendChild(document.createTextNode("Auto Maps")); abutton.setAttribute("class", "btn fightBtn btn-success"); abutton.setAttribute("id", "autoMapBtn"); abutton.setAttribute("onClick", "settingChanged('RunMapsWhenStuck')"); abutton.setAttribute("onmouseover", 'tooltip(\"Toggle Automapping\", \"customText\", event, \"Toggle automapping on and off.\")'); abutton.setAttribute("onmouseout", 'tooltip("hide")'); var fightButtonCol = document.getElementById("battleBtnsColumn"); newContainer.appendChild(abutton); fightButtonCol.appendChild(newContainer); //create automaps status newContainer = document.createElement("DIV"); newContainer.setAttribute("style", "display: block;"); newContainer.setAttribute("class", "battleSideTitle"); abutton = document.createElement("SPAN"); abutton.id = 'autoMapsStatus'; newContainer.appendChild(abutton); fightButtonCol.appendChild(newContainer); //make timer click toggle paused mode document.getElementById('portalTimer').setAttribute('onclick', 'toggleSetting(\'pauseGame\')'); document.getElementById('portalTimer').setAttribute('style', 'cursor: default'); //create container for settings buttons document.getElementById("settingsRow").innerHTML += '
'; } //toggles the display of the settings menu. function autoToggle(what){ if(what) { if(what.style.display === 'block') what.style.display = 'none'; else what.style.display = 'block'; } else { if (game.options.displayed) toggleSettingsMenu(); if (document.getElementById('graphParent').style.display === 'block') document.getElementById('graphParent').style.display = 'none'; var item = document.getElementById('autoSettings'); if(item.style.display === 'block') item.style.display='none'; else item.style.display = 'block'; } } //overloads the settings menu button to include hiding the auto menu settings. function autoPlusSettingsMenu() { var item = document.getElementById('autoSettings'); if(item.style.display === 'block') item.style.display='none'; toggleSettingsMenu(); } function createSetting(id, name, description, type, defaultValue, list, container) { var btnParent = document.createElement("DIV"); // btnParent.setAttribute('class', 'optionContainer'); btnParent.setAttribute('style', 'display: inline-block; vertical-align: top; margin-left: 1vw; margin-right: 1vw; margin-bottom: 1vw; width: 14.5vw;'); var btn = document.createElement("DIV"); btn.id = id; if (type == 'boolean') { if (autoTrimpSettings[id] === undefined) { autoTrimpSettings[id] = { id: id, name: name, description: description, type: type, enabled: false }; } btn.setAttribute('class', 'settingBtn settingBtn' + autoTrimpSettings[id].enabled); btn.setAttribute("onclick", 'settingChanged("' + id + '")'); btn.setAttribute("onmouseover", 'tooltip(\"' + name + '\", \"customText\", event, \"' + description + '\")'); btn.setAttribute("onmouseout", 'tooltip("hide")'); btn.textContent = name; btnParent.appendChild(btn) if(container) document.getElementById(container).appendChild(btnParent); else document.getElementById("autoSettings").appendChild(btnParent); } else if (type == 'value') { if (autoTrimpSettings[id] === undefined) { autoTrimpSettings[id] = { id: id, name: name, description: description, type: type, value: defaultValue }; } btn.setAttribute('class', 'noselect settingBtn btn-info'); btn.setAttribute("onclick", 'autoSetValueToolTip("' + id + '", "' + name + '")'); btn.setAttribute("onmouseover", 'tooltip(\"' + name + '\", \"customText\", event, \"' + description + '\")'); btn.setAttribute("onmouseout", 'tooltip("hide")'); btn.textContent = name; btnParent.appendChild(btn) if(container) document.getElementById(container).appendChild(btnParent); else document.getElementById("autoSettings").appendChild(btnParent); } else if (type == 'dropdown') { if (autoTrimpSettings[id] === undefined) { autoTrimpSettings[id] = { id: id, name: name, description: description, type: type, selected: defaultValue, list: list }; } var btn = document.createElement("select"); btn.id = id; if(game.options.menu.darkTheme.enabled == 2) btn.setAttribute("style", "color: #C8C8C8"); else btn.setAttribute("style", "color:black"); btn.setAttribute("class", "settingBtn"); btn.setAttribute("onmouseover", 'tooltip(\"' + name + '\", \"customText\", event, \"' + description + '\")'); btn.setAttribute("onmouseout", 'tooltip("hide")'); btn.setAttribute("onchange", 'settingChanged("' + id + '")'); for (var item in list) { var option = document.createElement("option"); option.value = list[item]; option.text = list[item]; btn.appendChild(option); } btn.value = autoTrimpSettings[id].selected; btnParent.appendChild(btn) if(container) document.getElementById(container).appendChild(btnParent); else document.getElementById("autoSettings").appendChild(btnParent); } } function settingChanged(id) { if (autoTrimpSettings[id].type == 'boolean') { autoTrimpSettings[id].enabled = !autoTrimpSettings[id].enabled; document.getElementById(id).setAttribute('class', 'settingBtn settingBtn' + autoTrimpSettings[id].enabled); updateCustomButtons(); } if (autoTrimpSettings[id].type == 'dropdown') { autoTrimpSettings[id].selected = document.getElementById(id).value; } } function autoSetValueToolTip(id, text) { ranstring = text; var elem = document.getElementById("tooltipDiv"); var tooltipText = 'Type a number below. You can also use shorthand such as 2e5 or 200k. Put -1 for Infinite.'; tooltipText += '