Skip to content

Commit

Permalink
autoeggs and fixes (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
Unihedro authored Apr 14, 2017
1 parent 91ceb10 commit 5229a4a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 21 deletions.
18 changes: 12 additions & 6 deletions AutoTrimps2.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// ==UserScript==
// @name AutoTrimpsV2+unimod
// @namespace https://github.com/unihedro/AutoTrimps
// @version 2.1.5.4u4-unimod-4-12-2017+Modular
// @version 2.1.5.4u5-unimod-4-14-2017+Modular
// @description try to take over the world!
// @author zininzinin, spindrjr, belaith, ishakaru, genBTC, Unihedron
// @include *trimps.github.io*
// @include *kongregate.com/games/GreenSatellite/trimps
// @grant none
// ==/UserScript==
var ATversion = '2.1.5.4u4-unimod-4-12-2017+Modular';
var ATversion = '2.1.5.4u5-unimod-4-14-2017+Modular';

////////////////////////////////////////////////////////////////////////////////
//Main Loader Initialize Function (loads first, load everything else)///////////
Expand Down Expand Up @@ -54,14 +54,17 @@ function initializeAutoTrimps() {

function printChangelog() {
tooltip('confirm', null, 'update', '\
<br><b style="background-color:#D8000B">4/12 v2.1.5.4u4</b> - AutoTrimps lifecycle changes\
<br><b class="AutoEggs">4/14 v2.1.5.4u5 - Auto Eggs</b>\
<br>Fix "auto start dailies" to now check for the entire week instead of only the two days!\
<br>Fix double attack calculation - it now addresses the second hit differently (upon killing it)\
<br>AutoGolden will now no longer conflict with Trimp\'s feature.\
<br><span style="opacity:.75"><b style="background-color:#D8000B">4/12 v2.1.5.4u4</b> - AutoTrimps lifecycle changes\
<br>Auto Heirlooms / Nu will only run in the portal screen, ONCE pre-autoportal, ONCE on Z1 in a new world, ONCE after your heirloom inventory size changes, or ONCE after you open and close the heirlooms screen manually.\
<br>Some functionality now only runs when you enter a new zone, as opposed to constantly re-doing everything.\
<br>I\'ll be pushing some more fixes soon to improve performance, stay tuned and report when things go wrong!\
<br><span style="opacity:.8">Fixed issue caused by ScryerSuicideZ - should now work properly</span>\
<br><b style="background-color:#105E28">4/11 v2.1.5.4u3</b> - fixed spire farming, autogen supply zone calculation\
<br><span style="background:rgba(255,0,128,.15)">Issues with AT misbehaving e.g. automaps screwing over might be resolved by disabling autogen! I personally haven\'t experienced issues but please send me your scenarios to help narrow down (and fix) the problem!</span>\
<br><span style="opacity:.75"><b style="background-color:#611047">4/10 v2.1.5.4u2</b> - new settings PrestigeSkip2\
<br><b style="background-color:#611047">4/10 v2.1.5.4u2</b> - new settings PrestigeSkip2\
<br><b style="background-color:#50000D">4/09 v2.1.5.4u1</b> - new tab Magma: AutoGen, AutoGen2\
<br><b style="background-color:#162955">4/08 v2.1.5.3u6</b> ForcePresZ <b style="background-color:#294D00">4/07 u5</b> FinishC2, PowerSaving <b style="background-color:#294D00">u4</b> PreferMetal, PreSpireNurseries <b style="background-color:#6E1236">u3</b> LinearZ, SupplyWall, OneTimeOnly <b style="background-color:#552700">u2</b> TrimpleZ, ScryerDieZ, IgnoreCrits <b style="background-color:#277552;">4/06 u1</b> Don\'t buy Coords / Skip challenge maps</span>\
<br><u>Report any bugs/problems please! You can find me on Discord: <span style="background-color:#ddd;color:#222">Uni#8610</span></u>\
Expand Down Expand Up @@ -188,14 +191,17 @@ function mainLoop() {
cancelTooltip();
}
setTitle(); // Set the browser title

if (getPageSetting('AutoEggs'))
easterEggClicked();
}
setScienceNeeded(); //determine how much science is needed

//EXECUTE CORE LOGIC
if (getPageSetting('ExitSpireCell') >0) exitSpireCell(); //"Exit Spire After Cell" (other.js)
if (getPageSetting('WorkerRatios')) workerRatios(); //"Auto Worker Ratios" (jobs.js)
if (getPageSetting('BuyUpgrades')) buyUpgrades(); //"Buy Upgrades" (upgrades.js)
autoGoldenUpgrades(); //"AutoGoldenUpgrades" (other.js)
autoGoldenUpgradesAT(); //"AutoGoldenUpgrades" (other.js)
if (getPageSetting('BuyStorage')) buyStorage(); //"Buy Storage" (buildings.js)
if (getPageSetting('BuyBuildings')) buyBuildings(); //"Buy Buildings" (buildings.js)
needGymystic = false; //reset this after buyBuildings
Expand Down
2 changes: 2 additions & 0 deletions NewUI2.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ function initializeAllSettings() {
createSetting('FinishC2', 'Finish Challenge2', 'Finish / Abandon Challenge2 (any) when this zone is reached, if you are running one. For manual use. Recommended: Zones ending with 0 for most challenges. Disable with -1.', 'value', -1, null, 'Uni');
createSetting('PowerSaving', ['Don\'t care', 'Power Saving', 'Only Rush Voids'], 'Avoid killing your army impatiently. Don\'t force abandon trimps when prestiging. Will still Die To Use Z and aggressively autostance to aid progression and anything else. Made for Empower daily, you might find it helpful if you\'re doing Workplace Safety feat. Then again with that I strongly recommend doing it fully manually. Anyway, don\'t blame me whatever happens. Only Rush Voids will allow considering abandoning, not force one. <b>Note: AT will no longer be able to fix when your scryer gets stuck!</b>', 'multitoggle', 0, null, 'Uni');
createSetting('PrestigeSkip2', 'Prestige Skip 2', 'If there are 2 or fewer <b>Unobtained Weapon Prestiges in maps</b>, ie: there are less than 2 types to run for, AutoMaps will not enter Prestige Mode, and/or will exit from it. For users who tends to not need the last few prestiges due to resource gain not keeping up. The amount of unboughts can be configured with MODULES.automaps.UnearnedPrestigesRequired. If PrestigeSkipMode is enabled, both conditions need to be reached before exiting.', 'boolean', false, null, 'Uni');
if (game.worldUnlocks.easterEgg)
createSetting('AutoEggs', 'AutoEggs', 'Click easter egg if it exists, upon entering a new zone. Warning: Quite overpowered. Please solemnly swear that you are up to no good.', 'boolean', false, null, 'Uni');
// Scryer settings
createSetting('UseScryerStance', 'Use Scryer Stance', '<b>MASTER BUTTON</b> Stay in Scryer stance in z181 and above (Overrides Autostance). Falls back to regular Autostance when not in use (so leave that on). Get 2x resources or Dark Essence. <u>All other buttons have no effect if this one is off.</u>', 'boolean', true, null, 'Scryer');
createSetting('ScryerUseWhenOverkill', 'Use When Overkill', 'Use when we can Overkill in S stance, for double loot with no speed penalty. Recommend this be on. NOTE: This being on, and being able to overkill in S will override ALL other settings <u>(Except never use in spire)</u>. This is a boolean logic shortcut that disregards all the other settings including Min and Max Zone. If you ONLY want to use S during Overkill, as a workaround: turn this on and Min zone: to 9999 and everything else off(red). ', 'boolean', true, null, 'Scryer');
Expand Down
3 changes: 2 additions & 1 deletion modules/autostance.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ function autoStance() {
baseDamage *= (game.global.titimpLeft > 0 ? 2 : 1); //consider titimp
//double attack is OK if the buff isn't double attack, or we will survive a double attack. see main.js @ 7197-7217 https://puu.sh/ssVNP/95f699a879.png (cant prevent the 2nd hit)
var isDoubleAttack = game.global.voidBuff == 'doubleAttack' || (enemy && enemy.corrupted == 'corruptDbl');
var doubleAttackOK = !isDoubleAttack || ((newSquadRdy && dHealth > dDamage * 2) || dHealth - missingHealth > dDamage * 2);
// quality bugfix by uni @ 2.1.5.4u5
var doubleAttackOK = true; // !isDoubleAttack || ((newSquadRdy && dHealth > dDamage * 2) || dHealth - missingHealth > dDamage * 2);
//lead attack ok if challenge isn't lead, or we are going to one shot them, or we can survive the lead damage
var leadDamage = game.challenges.Lead.stacks * 0.0003;
var leadAttackOK = game.global.challengeActive != 'Lead' || enemyHealth <= baseDamage || ((newSquadRdy && dHealth > dDamage + (dHealth * leadDamage)) || (dHealth - missingHealth > dDamage + (dHealth * leadDamage)));
Expand Down
2 changes: 1 addition & 1 deletion modules/other.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function autoRoboTrimp() {
}

//Version 3.6 Golden Upgrades
function autoGoldenUpgrades() {
function autoGoldenUpgradesAT() {
//get the numerical value of the selected index of the dropdown box
try {
var setting = document.getElementById('AutoGoldenUpgrades').value;
Expand Down
26 changes: 14 additions & 12 deletions modules/portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,21 @@ function doPortal(challenge) {
if (getPageSetting('AutoStartDaily')) {
selectChallenge('Daily');
checkCompleteDailies();
var yesterdayDone = (game.global.recentDailies.indexOf(getDailyTimeString(-1)) != -1);
var todayDone = (game.global.recentDailies.indexOf(getDailyTimeString()) != -1);
if (yesterdayDone && todayDone) {

var lastUndone = -7; // Note: Most previous challenge == -6
while (++lastUndone <= 0) {
var done = (game.global.recentDailies.indexOf(getDailyTimeString(lastUndone)) != -1);
if (!done)
break;
}

if (lastUndone == 1) { // None
debug("All available Dailies already completed.");
//Fallback to w/e Regular challenge we picked.
if(challenge)
selectChallenge(challenge);
} else if (!yesterdayDone) {
getDailyChallenge(-1);
debug("Portaling into Daily for: " + getDailyTimeString(-1,true) + " now!");
} else if (!todayDone) {
getDailyChallenge(0);
debug("Portaling into Daily for: " + getDailyTimeString(0,true) + " now!");
//Fallback to w/e Regular challenge we picked. Or none (unselect)
selectChallenge(challenge || 0);
} else {
getDailyChallenge(lastUndone);
debug("Portaling into Daily for: " + getDailyTimeString(lastUndone, true) + " now!");
}
}
//Regular Challenge:
Expand Down
17 changes: 16 additions & 1 deletion tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,19 @@ ul.tab li a:hover {background-color: #ddd;}
@keyframes fadeEffect {
from {opacity: 0;}
to {opacity: 1;}
}
}

#tipText b.AutoEggs,
#AutoEggs.settingBtntrue {
-webkit-animation: eggGradient 3s infinite;
animation: eggGradient 3s infinite;
color: black;
}

@keyframes eggGradient {
0% { background-color: #83ddd6; }
25% { background-color: #f4c7c7; }
50% { background-color: #8beab7; }
75% { background-color: #f6f297; }
100% { background-color: #83ddd6; }
}

0 comments on commit 5229a4a

Please sign in to comment.