-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoGodzamok, autoSL & autoRigidel #45
Conversation
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
Attempt to restore the autoGodzamok Sane and Insane options. Has to be tested to make sure everything behaves as it should.
Second try And some minor changes to make it more efficient.
Third try Preventing the sell of cursors and farms while Devastation is active.
finalizing autoGodzamok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, with autoGodz, your intent is that nothing will be rebought unless you have it in insane mode, correct?
Here's the three behaviors as coded in this PR:
- Sell the cursors and farms. Don't buy any more. If more cursors and farms appear during the devastation buff (like from user purchases or auto buy) sell those too.
- Sell the cursors and farms. Don't buy any more. Don't do anything else during the devastation buff. If more cursors and farms appear during the devastation buff (like from user purchases or auto buy) nothing will happen to those.
- Sell the cursors and farms. Rebuy the amount that was sold. Repeat continuously during the buff.
Is that the intent for all?
As an aside, I actually completely rewrote AutoGodz in my dev branch to auto calculate whether there would be a positive payoff based on the current click rate, then to auto-cycle buying and selling just cursors in smaller amounts (1/10 of the actual initial sale) to jack up the buff before buying them all back at the end.
It's not quite ready for a PR, though, because I'm still tweaking to get the right balance between wanting it to be net positive all the time and making sure it's getting the highest buff. Take a look, though, if you want to see what I'm doing.
The Intent of autoGodz is to trigger on Clickfrenzies or Dragonflight. I think Sane mode is what should be kept in the code. I've just checked and selling the farms doesn't increase the percentages on the buff. As of your rewrite autoGodz looks promising I'm looking forward to a finished version. Maybe we should setup a discord to discuss certain behaviors of the game and the intended code of Frozencookies |
Yeah, I'm up for a Discord or something. In terms of intended behavior, I don't see much need for the three modes. For the moment, let's ignore my experiments in maximizing gain. If I wasn't doing that, here's how I think I would do it (to keep it as simple as possible:
And are you sure about the farms not adding to the bonus? The graphic on screen won't update, but when you call Game.buffs["Devastation"].multClick after selling some more buildings, the value is added. |
Ok i'll setup a discord for the development of this addon. ill update it on readme.md when ready. I totally agree with you to keep it as simple as possible. I'll make the necessary changes. |
Just to clarify further.
Should the bought buildings be sold because Devastation is active? to gain more as seen in Game.buffs["Devastation"].multClick |
For the duration of that one devastation buff, there should be no more further selling of buildings. If buildings were sold (triggering a buff), then rebought, everything just sits there for the duration of the ten seconds. When that's expired, if there's still a dragon flight or click frenzy active, the cycle might repeat. This mimics the "sane" mode of the previous implementation as far as I know just with the added bit of buying the buildings back in one bunch if auto buy is already on, rather than waiting for auto buy to buy them back one at a time (as would happen if the autogodz function didn't do the buying. |
simplified autoGodzamok. - If AutoGodz is on and a click buff is active, but Devastation is NOT active: - sell the cursors and farms - if autoBuy is turned on, the user has already signaled their intent to have things purchased for them, so rebuy what you sold (up to the limit if any limit is set). - Otherwise, don't rebuy anything.
Removed Sane and Insane mode from autoGodzamok cause they were removed.
Reversed the variables of buy back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you left 1 farm behind when selling the farms. buying farmMax
farms in line 2200 will end up with one farm over the limit. Should probably be
safeBuy( Game.Objects['Farm'], FrozenCookies.farmMax - 1 );
Yeah true but this way you get the full 500% potential instead of the 490% you would get if you sold 499 farms |
Used the wrong parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to look at the limit that's set because otherwise you'll way overbuy. If I have 300 cursors when AutoGodz kicks in, but a limit of 500 cursors, this way it will try to buy 500 cursors after selling.
Should probably check both things though, because I think you might be able to have a limit number set, but have the ability to use the limit turned off. Here's what I was using before:
if ( FrozenCookies.autoBuy == 1 ) {
if (Game.Objects.Cursor.amount < 10) {
if ((FrozenCookies.cursorLimit) && countC > FrozenCookies.cursorMax) {
safeBuy(Game.Objects['Cursor'], FrozenCookies.cursorMax);
logEvent("AutoGodzamok", "Bought " + FrozenCookies.cursorMax + " cursors");
} else {
safeBuy(Game.Objects['Cursor'], countC);
logEvent("AutoGodzamok", "Bought " + countC + " cursors");
}
}
if (Game.Objects.Farm.amount < 10) {
if ((FrozenCookies.farmLimit) && countF > (FrozenCookies.farmMax - 1)) {
safeBuy(Game.Objects['Farm'], FrozenCookies.farmMax - 1);
logEvent("AutoGodzamok", "Bought " + (FrozenCookies.farmMax - 1) + " farms");
} else {
safeBuy(Game.Objects['Farm'], countF);
logEvent("AutoGodzamok", "Bought " + countF + " farms");
}
}
}
And to your other point, the buff multiplier is set when the buildings are sold, so buying an extra one would only help on the next buff, not the current one. And each building is only +1%, so buying the extra one would give you +500% instead of +499%, which translates to a multClick
value on the buff of 6
instead of 5.99
. Not a significant difference, and it would look to the user to be an error if they started the click frenzy/dragonflight with 500 farms and ended with 501.
For some reason, I was thinking about every 10 buildings = 1%. |
Extra check if the limit doesn't exceed the current buildings.
That <10 thing was in the code before, so I left it as an extra check in case the sell failed and the cursors/farms didn't actually get down that low. If the sell failed, you'd essentially double your existing cursors/farms. I don't know if it's possible for the sell to fail, though. Sure, a buy can fail if you don't have cookies in the bank, but is there any scenario where a sell can fail? I can't think of one, so you're probably right that it's pointless. |
Forgot to add -1 to the buyback of farms
* autoGodzamok, autoSL & autoRigidel (Mtarnuhal#45) * Fix Mtarnuhal#18 autoSL + autoRigidel 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 * autoGodzamok Sane & Insane option restored Attempt to restore the autoGodzamok Sane and Insane options. Has to be tested to make sure everything behaves as it should. * Update frozen_cookies.js * Attempt fix autoGodzamok Sane and Insane Second try And some minor changes to make it more efficient. * safeBuy safeBuy instead of visually change the buy-sell option. Changing the variable should be enough. * Attempt fix autoGodzamok Sane and Insane Third try Preventing the sell of cursors and farms while Devastation is active. * Finalizing autoGodzamok finalizing autoGodzamok * Update Version 1.8.1 * Simplifying autoGodzamok simplified autoGodzamok. - If AutoGodz is on and a click buff is active, but Devastation is NOT active: - sell the cursors and farms - if autoBuy is turned on, the user has already signaled their intent to have things purchased for them, so rebuy what you sold (up to the limit if any limit is set). - Otherwise, don't rebuy anything. * Remove unnecessary autoGodzamok preference Removed Sane and Insane mode from autoGodzamok cause they were removed. * autoGodzamok Reversed variables Reversed the variables of buy back * autoGodzamok wrong parameter Used the wrong parameter * autoGodzamok extra check Extra check if the limit doesn't exceed the current buildings. * autoGodzamok Forgot to add -1 to the buyback of farms * show current buff value on Devastation tooltip (Mtarnuhal#46) Co-authored-by: Mtarnuhal <[email protected]>
Fix #18 autoSL + autoRigidel bug where sugar lumps were collected to quickly
autoGodzamok Sane & Insane options Restored