Skip to content

Commit

Permalink
Fix #18 autoSL + autoRigidel
Browse files Browse the repository at this point in the history
Seems Auto harvest, and auto rigidel+harvest attempt to harvest a sugar lump just a teensy bit before it's actually ripe, therefore botching the harvest in half the cases. Game.timetoRipe returns a float number in some cases, so adding Math.ceil to the Game.timeToRipe in the equations should give it just enough leeway to make sure it computes the correct millisecond. (It's my theory anyway. The math seemed to have come out ok when I paper tested).
With thnx to @Darkroman
  • Loading branch information
Mtarnuhal authored Oct 21, 2020
1 parent 04a3183 commit e4fa7b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fc_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ function swapIn(godId, targetSlot) { //mostly code copied from minigamePantheon.

function autoRigidel() {
if (!T) return; //Exit if pantheon doesnt even exist
var timeToRipe = (Game.lumpRipeAge - (Date.now() - Game.lumpT))/60000; //Minutes until sugar lump ripens
var timeToRipe = (Math.ceil(Game.lumpRipeAge) - (Date.now() - Game.lumpT))/60000; //Minutes until sugar lump ripens
var orderLvl = Game.hasGod('order') ? Game.hasGod('order') : 0;
switch (orderLvl) {
case 0: //Rigidel isn't in a slot
Expand Down Expand Up @@ -2259,7 +2259,7 @@ function autoCookie() {
}
if (FrozenCookies.autoSL) {
var started = Game.lumpT;
var ripeAge = Game.lumpRipeAge;
var ripeAge = Math.ceil(Game.lumpRipeAge);
if ((Date.now() - started) >= ripeAge) {
Game.clickLump();
}
Expand Down

0 comments on commit e4fa7b9

Please sign in to comment.