elliotks / ACABM

Cookie Clicker - Auto Click and Buy Mod
GNU General Public License v3.0
3 stars 1 forks source link

Feature Requests: Feature parity with depricated mod Cookie Assistant #2

Open sigboe opened 8 months ago

sigboe commented 8 months ago

Feature Requests: Feature parity with depricated mod Cookie Assistant

Keep in mind I think this Auto Click And Buy Mod is superior, as Cookie Assistant sadly just buys anything that it can afford

Hey I know this request might be too much, but I wish for feature parity with Cookie Assistant. Some of these features are easy to implement, some of these might require a bit of work. But Cookie Assistant is lisenced under MIT, so lifting whole pieces of code right from it is allowed. https://github.com/hitsub/CookieAssistant

Keep in mind that the FtHoF and auto sell buildings (and other features) are implemented "not smartly". There is much room for improvement in this department, but the way Cookie Assistant implements it today is quite helpful in its current state. But possible improvements include selling and buying wizard towers in a smarter way, since this is the most efficient way of getting cookies in the end game. And a macro to unlock the Four-leaf cookie shadow achievement would also be nice. As this is related to buying and selling wizard towers to stack golden cookies anyway

elliotks commented 8 months ago

Hi @sigboe

Thank you for this request, I will need to review further. Are there any features from the list you would like me to prioritize implementing?

Thanks,

sigboe commented 8 months ago

@elliotks Thanks for considering this request! The main feature I would like is auto casting FtHoF, though I do think this is one of the weaker parts of the deprecated Cookie Assistant

An easy one (I presume) is to auto buy chocolate egg when ascending, possibly even selling all buildings before ascending?

Another one I presume is a low hanging fruit, is just to switch seasons to another season if you are not in a current season or have all the upgrades. But you might want to implement first auto buying santa upgrades first. So this might not be low hanging fruit without ignoring that for the time being.

Also I am very sorry, because when trying to sleep the other day I realized that code can't be lifted whole sale from Cookie Assistant, because it uses CCSE, to do stuff.

Another thing I miss from Cookie Assistant is that it has an option for how many buildings to buy at once. I don't like the user experience of buying the amount you pick from the right side buttons. Note that this also breaks when trying to press the sell button. Try have auto buy on, and sell a farm, it will start selling farms until there are no more farms. Another issue is if you are trying to use Rigidel in the pantheon to speed up sugar lumps, we need the total amount of buildings to be a multiple of 10. One wishful thinking is you could programmatically make an educated guess how many to buy.

I really like the ascend luck function! For me it only works 1/3 of the time when I get prestige quickly though, I guess that is hard to fix. But one improvement I would like is to make sure you can afford the next luck upgrade when ascending with the digits for it.

Also I don't get the point of this text string image what is the point of explicitly saying that it is over 120? I would prefer years, months, days, minutes, seconds. I know that can be a bit tedious without external dependencies. Maybe something simple like (haven't tested it)

function convertSeconds(seconds) {
    const years = Math.floor(seconds / (3600 * 24 * 365));
    const months = Math.floor((seconds % (3600 * 24 * 365)) / (3600 * 24 * 30));
    const days = Math.floor(((seconds % (3600 * 24 * 365)) % (3600 * 24 * 30)) / (3600 * 24));
    const minutes = Math.floor((seconds % 3600) / 60);
    const remainingSeconds = seconds % 60;

    if (years > 0) {
        return years + (years === 1 ? ' year' : ' years');
    } else if (months > 0) {
        return months + (months === 1 ? ' month' : ' months');
    } else if (days > 0) {
        return days + (days === 1 ? ' day' : ' days');
    } else if (minutes > 0) {
        return minutes + (minutes === 1 ? ' minute' : ' minutes') + ' and ' + remainingSeconds + (remainingSeconds === 1 ? ' second' : ' seconds');
    } else {
        return seconds + (seconds === 1 ? ' second' : ' seconds');
    }
}
elliotks commented 8 months ago

Thanks @sigboe

I am familiar with CCES, most of the mods that are put out there using CCES usually take advantage of the menu system. But the core scripting is still understandable.

An example from the CookieAssistant BuyChocolateEgg function

    CookieAssistant.BuyChocolateEgg = function()
    {
        let egg = Game.UpgradesInStore.find(x => x.name == "Chocolate egg");
        if (egg == undefined)
        {
            Game.Notify(CookieAssistant.name, "チョコの卵の購入に失敗しました。<br />Failed to buy Chocolate Egg.");
            return;
        }
        if (Game.dragonLevel >= 8 && !Game.hasAura("Earth Shatterer"))
        {
            Game.SetDragonAura(5, 0);
            Game.ConfirmPrompt();
        }
        for (let objectName in Game.Objects) {
            let building = Game.Objects[objectName];
            if (building.amount > 0)
            {
                building.sell(building.amount);
            }
        }
        egg.buy();
    }

When you see things such as Game.X that is a core Cookie Clicker function being leveraged by the mod. So my process would be to review each feature - make adjustments to the original code, then migrate it to ACABM. If it's a feature that need to be looped on an interval - then I would need to add to ACABM this.actions = {... create the function to bind to, add menu update.

I am currently working on updating ACABM to support translations natively as well.

Considering the amount of changes that are required to add CookieAssistant features - I will more than likely want to have a test phase before pushing out to the Steam Workshop. Are you familiar with installing mods manually? If so, I would like to have you test the features out to confirm they are working as intended when I get to that point.

Thank you for your feedback on the current state of the mod as well. Almost everything I have added/changed/fixed was based on user feedback. I really like the ascend luck function! For me it only works 1/3 of the time when I get prestige quickly though, I guess that is hard to fix. But one improvement I would like is to make sure you can afford the next luck upgrade when ascending with the digits for it.

The thought went through my mind on this, but never implemented it. I will add it to my list as it's not difficult to add.

what is the point of explicitly saying that it is over 120? I would prefer years, months, days, minutes, seconds. I know that can be a bit tedious without external dependencies. Maybe something simple like (haven't tested it)

ACABM used to be pretty vague and a lot of users were confused if "AutoBuy" was working or not. So when I included the menu system that is what I came up with. Over 120 means that the upgrade/building would take over 120 seconds to buy, so it is not queued in the mod for purchase. I like the idea of the "human readable" format and will incorporate that idea. If you have a better recommendation on the verbiage (anywhere in the mod really) - I am open to all suggestions on how to better present the information for users to understand.

elliotks commented 8 months ago

@sigboe

I am moving along here, I changed the "AutoBuy wants to buy:..." verbiage to be human readable and remove the "over 120" to reduce confusion.

I was able to reproduce the issue with AutoBuy constantly selling. In my current testing phase to resolve this by switching to buy mode when AutoBuy queues a buy. But the outcome is that AutoBuy will almost immediately try to buy, basically trying to buy what you just sold.

I could implement a check to see if Game.buyMode === -1 (sell mode), and if true `ACABM.abmessage["buy"] = "You are currently in Sell mode, switch back to to continue" (which is displayed in the "AutoBuy wants to buy..." section of the options menu, and return. But wanted to get your thoughts on that.

Thanks,

sigboe commented 8 months ago

@elliotks This is definitely a valid workaround! IIRC Cookie Assistant has the same issue, so this is a straight improvement!