Daniel P. Barron

Move Bundles to Container When Training

Wednesday, May 3, 2017

This code is no longer needed since Mocky's great work on the client.

In the world of Eulora, it's become in vouge to pre-bundle ingredients before starting a craft run. That's because a somewhat recent update changed the way blueprints work. The number of ingredients your charcter needs might, and often do, change throughout the course of a craft run. This can cause the craft bot to jam up, and a jammed bot is time wasted.

There's a problem with pre-bundling though: FoxyBot doesn't know to move the bundles to the craft container when it needs to train. Depending on your motivation for crafting, this can be worse than a jam! It'll keep on going, but without training; you'll be wasting experience.

The fix is easy. Open up ~/development/EuloraV0.1.2/src/client/foxybot/botactivity.cpp and skip down to the CraftActivity::MoveToContainer() function. I have copied the relevant section below, and the part you want to add is in bold.

void CraftActivity::MoveToContainer()
{

...

        while (iterIngredients.HasNext() )
        {
                csString itemName;
                iterIngredients.Next(itemName);

                psInventoryCache::CachedItemDescription* from = worldHandler::FindItemSlot(itemName, false);
                if (from)
                {
                        worldHandler::MoveItems(from->containerID, from->slot, toContainer, nextEmptySlot, from->stackCount);
                }
                nextEmptySlot = nextEmptySlot + 1;
        }

        //move bundles too
        psInventoryCache::CachedItemDescription * from_bundle = worldHandler::FindItemSlot(rcp.GetBundleName(), false);
        if (from_bundle)
        {
                worldHandler::MoveItems(from_bundle->containerID, from_bundle->slot, toContainer, nextEmptySlot, from_bundle->stackCount);
                nextEmptySlot = nextEmptySlot + 1;
        }

        //move recipes too
        psInventoryCache::CachedItemDescription * from = worldHandler::FindItemSlot(rcp.GetRecipeName(), false);
        if (from)
                worldHandler::MoveItems(from->containerID, from->slot, toContainer, nextEmptySlot, from->stackCount);

        OutputMsg(csString("Done moving items to container.") );
}

Write the file, and cd ~/development/EuloraV0.1.2 ; jam -aq clienti to recompile the client with the changes.

  1. You can get away with jam -q client since this change doesn't touch botactivity.h -- but it doesn't hurt to do a full recompile. This single letter has lead to days of confusion on my part.

Leave a Reply

Your words may be altered or altogether purged in accordance with my preference to abstain from publishing statements that may be unnecessarily offensive to other observers.