diff --git a/AutoTrimps2.js b/AutoTrimps2.js index 83ff318ca..a16f7b881 100644 --- a/AutoTrimps2.js +++ b/AutoTrimps2.js @@ -1,7 +1,7 @@ // ==UserScript== // @name AutoTrimpsV2+genBTC // @namespace http://tampermonkey.net/ -// @version 2.1.2.12-genbtc-11-21-2016+AutoPerks +// @version 2.1.3.0-genbtc-11-22-2016+AutoPerks // @description try to take over the world! // @author zininzinin, spindrjr, belaith, ishakaru, genBTC // @include *trimps.github.io* @@ -12,7 +12,7 @@ //////////////////////////////////////// //Variables///////////////////////////// //////////////////////////////////////// -var ATversion = '2.1.2.12-genbtc-11-21-2016+AutoPerks'; +var ATversion = '2.1.3.0-genbtc-11-22-2016+AutoPerks'; var AutoTrimpsDebugTabVisible = true; var enableDebug = true; //Spam console var autoTrimpSettings = {}; @@ -1065,20 +1065,33 @@ function safeBuyBuilding(building) { if (game.buildings[building].locked) return false; preBuy(); - game.global.buyAmt = 1; - if (!canAffordBuilding(building)) { - postBuy(); - return false; + //build 2 at a time if we have the mastery for it. + if (game.talents.doubleBuild.purchased) { + game.global.buyAmt = 2; + if (!canAffordBuilding(building)) { + game.global.buyAmt = 1; + if (!canAffordBuilding(building)) { + postBuy(); + return false; + } + } + } + else { + game.global.buyAmt = 1; + if (!canAffordBuilding(building)) { + postBuy(); + return false; + } } game.global.firing = false; //buy max warpstations when we own <2 (ie: after a new giga) //thereafter, buy only 1 warpstation if(building == 'Warpstation'){ - if (game.buildings.Warpstation.owned < 2) { + if (game.buildings.Warpstation.owned < 3) { game.global.buyAmt = 'Max'; game.global.maxSplit = 1; } else { - game.global.buyAmt = 1; + game.global.buyAmt = game.talents.doubleBuild.purchased ? 2 : 1; } buyBuilding(building, true, true); debug('Building ' + game.global.buyAmt + ' ' + building + 's', "buildings", '*rocket'); @@ -2599,11 +2612,13 @@ function checkSettings() { //Actually Portal. function doPortal(challenge) { if(!game.global.portalActive) return; + if (getPageSetting('AutoMagmiteSpender')) + autoMagmiteSpender(); portalClicked(); if(challenge) selectChallenge(challenge); activateClicked(); activatePortal(); - lastHeliumZone = 0; + lastHeliumZone = 0; zonePostpone = 0; } //Controls "Manage Breed Timer" and "Geneticist Timer" - adjust geneticists to reach desired breed timer @@ -2869,6 +2884,47 @@ function useScryerStance() { } } +//Auto Magmite spender before portal +function autoMagmiteSpender() { + var repeat = true; + while (repeat) { + try { + //list of available upgrades (doesnt handle one-time upgrades) + var names = ["Efficiency","Capacity","Supply"]; + var lowest = [null,null]; //keep track of cheapest one + //cycle through: + for (var i=0; i < names.length; i++) { + var item = names[i]; + var upgrade = game.generatorUpgrades[item]; + if (typeof upgrade === 'undefined') + return; //error-resistant + var cost = upgrade.cost(); + //store the first upgrade once + if (lowest[1] == null) + lowest = [item,cost]; + //always load cheapest one in. + else if (cost < lowest[1]) + lowest = [item,cost]; + } + //if we can afford anything, buy it: + if (game.global.magmite > lowest[1]) { + buyGeneratorUpgrade(lowest[0]); + debug("Auto Spending " + lowest[1] + " Magmite on: " + lowest[0] + " #" + game.generatorUpgrades[lowest[0]].upgrades, "general"); + } + //if we can't. exit the loop + else + repeat = false; + } + //dont get trapped in a while loop cause something stupid happened. + catch (err) { + debug("Error encountered: " + err.message,"general"); + repeat = false; + } + } + //print the result + debug("Leftover magmite: " + game.global.magmite,"general"); + return; +} //////////////////////////////////////////////////////////////////////////////// //Main Loader Initialize Function (loads first)///////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -2906,7 +2962,7 @@ function delayStart() { function delayStartAgain(){ setInterval(mainLoop, runInterval); updateCustomButtons(); - tooltip('confirm', null, 'update', 'ChangeLog: -Please Read-
11/21 Patch 4.0 fixes are happening!
Entirely remove high lumberjack ratio during Spire.
During Magma with 3000+ Tributes, switch to 1/2/2 auto-worker-ratios instead of 1/2/22.
Add a 10 second timeout Popup window that can postpone Autoportal when clicked.
Added a No Nurseries Until setting in genBTC page

11/20 Fixed spire map bug
Added new ratios to AutoPerks
AutoFight if timer is <0.5 not <0.1 now
11/19 Doesnt run the 10 maps for Mapbonus before Spire now. Please increase/adjust your MinutesBeforeSpire Timer accordingly (the 10 maps were never accounted for in that timer).
Re-arranged all the categories in the settings window and updated tooltips
Kill your trimps (AutoHomicide) for Anti-Stacks more aggressively', 'cancelTooltip()', 'Script Update Notice ' + ATversion); + tooltip('confirm', null, 'update', 'ChangeLog: -Please Read-
11/21 Patch 4.0 fixes are happening!
-Auto Spend Magmite before portaling - setting in genBTC page - (buys cheapest non-permanent upgrade)
Buy 2 buildings instead of 1 if we have the mastery.
Entirely remove high lumberjack ratio during Spire.
During Magma with 3000+ Tributes, switch to 1/2/2 auto-worker-ratios instead of 1/2/22.
Add a 10 second timeout Popup window that can postpone Autoportal when clicked.
Added a No Nurseries Until setting in genBTC page
', 'cancelTooltip()', 'Script Update Notice ' + ATversion); document.getElementById('Prestige').value = autoTrimpSettings.PrestigeBackup.selected; } diff --git a/NewUI2.js b/NewUI2.js index 7dede0a0b..b47072099 100644 --- a/NewUI2.js +++ b/NewUI2.js @@ -188,6 +188,8 @@ createSetting('AutoHeirlooms2', 'Auto Heirlooms2', 'IMPORTANT SETTING. New algor createSetting('AutoUpgradeHeirlooms', 'Auto Upgrade Heirlooms', 'Automatically buys the upgrades the script advises for the Equipped shield and staff, until we are out of nullifium.', 'boolean', null, null,'genBTC'); createSetting('TrainerCaptoTributes', 'Cap Trainers to a % of Tributes', 'Only Buy a Trainer when its cost is LESS than X% of cost of a tribute. This setting can work in combination with the other one, or set the other one to -1 and this will take full control. Default: -1 (Disabled). 50% is close to the point where the cap does nothing. You can go as low as you want but recommended is 10% to 1%. (example: Trainer cost of 5001, Tribute cost of 100000, @ 5%, it would NOT buy the trainer.)', 'value', '-1', null, 'genBTC'); createSetting('NoNurseriesUntil', 'No Nurseries Until z', 'For Magma z230+ purposes. Nurseries get shut down, and wasting nurseries early on is probably a bad idea. Might want to set this to 230+ for now.', 'value', 0, null, 'genBTC'); +createSetting('AutoMagmiteSpender', 'Auto Spend Magmite', 'Auto Spends any unspent Magmite immediately before portaling. Buys cheapest non-permanent upgrade. For Magma z230+ purposes. EXPERIMENTAL.', 'boolean', false, null, 'genBTC'); + // Scryer settings createSetting('UseScryerStance', 'Use Scryer Stance', 'Stay in Scryer stance in z181 and above (Overrides Autostance). Falls back to regular Autostance when not in use (so leave that on). Current point is to get Dark Essence. EXPERIMENTAL. This is the Master button. All other buttons have no effect if this one is off.', 'boolean',true,null,'Scryer'); createSetting('ScryerMinZone', 'Min Zone', 'Minimum zone to start using scryer in.(inclusive) rec:(60 or 181)', 'value', '181', null, 'Scryer'); diff --git a/README.md b/README.md index 680029c4b..56b96342a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,24 @@ Notes: If you would like to use only the graphs module, replace `AutoTrimps2.js` with `Graphs.js` in the bookmark or your userscript. Feel free to submit any bugs/suggestions as issues here on github. -## Most recent feature changes by genBTC (up to date as of 8/5/2016): +## Current feature changes by genBTC (up to date as of 11/22/2016): +-11/21 Patch 4.0 fixes are happening! +-Auto Spend Magmite before portaling - setting in genBTC page - (buys cheapest non-permanent upgrade) +-Buy 2 buildings instead of 1 if we have the mastery +-Entirely remove high lumberjack ratio during Spire. +-During Magma with 3000+ Tributes, switch to 1/2/2 auto-worker-ratios instead of 1/2/22. +-Add a 10 second timeout Popup window that can postpone Autoportal when clicked. +-Added a No Nurseries Until setting, in genBTC page +-11/20 Fixed spire map bug +-Added new ratios to AutoPerks (ZXV3,truth_late) +-AutoFight if timer is <0.5 not <0.1 now +-11/19 Doesnt run the 10 maps for Mapbonus before Spire now. Please increase/adjust your MinutesBeforeSpire Timer accordingly (the 10 maps were never accounted for in that timer). +-Re-arranged all the categories in the settings window and updated tooltips +-Kill your trimps (AutoHomicide) for Anti-Stacks more often + +## Gap in Changelog exists here. + +## Prior feature changes by genBTC (up to date as of 8/5/2016): - Minutes to Farm Before Spire - force some time to be spent so you can for sure complete Spire (recommended: 3-10 minutes) - Auto Upgrade Heirlooms - spends ALL your nullifium on the recommended upgrades - Auto Golden Upgrades = Buys all the Golden Helium, Battle, or Voids when available. @@ -59,6 +76,8 @@ Feel free to submit any bugs/suggestions as issues here on github. - Helium per Hour Portal "Buffer" - now you can customize how much He/Hr is allowed to drop before portaling - Auto Robo Trimp - activate the MagnetoShriek ability on the bosses every 5 levels starting from the level you specify. (recommended set to 60) +## Gap in Changelog exists here. + ## Feature changes added by genBTC since before 4/27/2016 and Trimps version 3.22: - Change Genetecist Timer to 10 sec instead of 11sec. (was commonly showing 11.4s because it rounds. that is too much) - 'Farm on >7 NomStacks': During Nom, take precautions not to get too many stacks. (On Improbability(cell 100). Meant to be used with DisableFarming (otherwise farming would take care of this, but its slower). If Improbability already has 5 NomStacks, stack 30 Anticipation. If the Improbability has >7 NomStacks on it, get +200% dmg from MapBonus. If we still cant kill it, enter Farming mode at 30 stacks, Even with DisableFarming On!') @@ -101,8 +120,8 @@ many warpstations as it can afford. In this way it can buy over the cap. I think - Regular Tox-Run: Avoid another non-unique map cycle due to having the amount of tox stacks we need. - Max-Tox Run: During a Toxicity + Max Tox run AutoPortal, unset the MaxTox setting from the settings page, so we dont' run 2 Max-Tox's in a row (will go back to normal Tox run). -## Original Version's Previous Recent changes -See changelog at the original version's github page: https://github.com/zininzinin/AutoTrimps +## Original zininzinin version's historical changes +See changelog at the original version's github page: https://github.com/zininzinin/AutoTrimps/blob/c8eac4c80d0a1a5ebe36bc44c7655c335a2dea7b/README.md#recent-changes ## Colors for upgrades highlights