What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Loki.Bot.v3.Coroutines.IdItemsUsingInventoryCorout ine anyone used?

WhereIsMyMind

Member
Joined
Oct 12, 2013
Messages
848
Sup.

Loki.Bot.v3.Coroutines.IdItemsUsingInventoryCoroutine anyone used that? can I have some example code?

I ask as I cannot find doc beyond the following, where can I get more on IdItemsDelegate?? Because farked if I can figure this one out.

public static System.Threading.Tasks.Task<Coroutines.IdItemsCoroutineError> IdItemsUsingInventoryCoroutine([Loki.Bot.v3.Coroutines.IdItemsDelegate shouldIdItem = null], [object user = null])
Member of Loki.Bot.v3.Coroutines

Summary:
This coroutine will id all items in the inventory that match the shouldIdItem delegate until no more items remain, or there are no more id scrolls to use. It looks for id scrolls in the main inventory.

Parameters:
shouldIdItem: The delegate that determines if an item should be ided.
user: The user object that should be passed through the IdItemsDelegate.

Returns:
An IdItemsCoroutineError error that describes the result.

wimm
 
Sup.

Loki.Bot.v3.Coroutines.IdItemsUsingInventoryCoroutine anyone used that? can I have some example code?

I ask as I cannot find doc beyond the following, where can I get more on IdItemsDelegate?? Because farked if I can figure this one out.



wimm

The delegate is sort of a "custom method" that will tell if it should ID it.

Here's an example of the signature for the ShouldWithdraw delegate (it may be different for the ShouldId) :

Code:
private bool ShouldWithdrawItem(Item item, out int count, object user)

This is what you gonna need for the ID. Basically you return true if so, else false.
The checks are located in the delegate, and for the call :

Code:
var xdlolwtfbbq = await Coroutines.IdItemsUsingInventoryCoroutine(ShouldId);

xdlolwtfbbq is the error returned by the coroutine, here are the errors that can be thrown :

gtnH3oW.png
 
Last edited:
much thanks. I am fighting forward :) This could still all blowup in my face as I am calling from ingame, not in town or HO.

aha, great example in ChaosChanceRecipe

Code:
 private bool ShouldWithdrawItem(Item item, out int count, object user)
            {
                count = item.StackCount;

                // We only want unided rares.
                if (item.IsIdentified || item.Rarity != Rarity.Rare)
                    return false;

                if (_useChanceInstead)
                {
                    // If we want Chance orbs.
                    if (item.ItemLevel >= 60)
                        return false;
                }
                else
                {
                    // If we want Chaos orbs.
                    if (item.ItemLevel < 60)
                        return false;
                }

                UpdateNeeds();

                if (_needsHelm)
                {
                    if (item.IsHelmetType)
                    {
                        return true;
                    }
                }

            [wimm edit]

                return false;
            }

and

Code:
...

                var sicerr = await Coroutines.SellItemsCoroutine(ShouldAcceptSellOffer, ShouldSellItem);
                if (sicerr != Coroutines.SellItemsCoroutineError.None)
                {
                    Log.ErrorFormat("[ChaosAndChanceRecipeSellTask] SellItemsCoroutine returned {0}.", sicerr);
                    BotManager.Stop();
                    return true;
                }
...

private bool ShouldSellItem(Item item, object user)
            {
                // We only want unided rares.
                if (item.IsIdentified || item.Rarity != Rarity.Rare)
                    return false;

                if (_useChanceInstead)
                {
                    // If we want Chance orbs.
                    if (item.ItemLevel >= 60)
                        return false;
                }
                else
                {
                    // If we want Chaos orbs.
                    if (item.ItemLevel < 60)
                        return false;
                }

                // We assume nothing else is in the inventory to sell.

                return true;
            }


wimm
 
Last edited:
Hey friend, i myself had to face this problem, and i decided to create my Id logic.
Is pretty simple:

get the item to ID in your inventory
get a SoW
use the SoW on the item
Now you face the problem that the item become a new item in memory and you need to find what it become.
I do so by storing a couple of info about the item before to ID it (short name, level, quality, rarity) use all the info that won't change on the item, to be sure to locate it after ID.
Then using those info, locate the new item in the inventory and Voila!

This might not be the best way, but work perfectly for my purpose, might work for you to.
Send me a PM if you need more info, i'll do what i can to help you.

/hat
 
Hey friend, i myself had to face this problem, and i decided to create my Id logic.
Is pretty simple:

get the item to ID in your inventory
get a SoW
use the SoW on the item
Now you face the problem that the item become a new item in memory and you need to find what it become.
I do so by storing a couple of info about the item before to ID it (short name, level, quality, rarity) use all the info that won't change on the item, to be sure to locate it after ID.
Then using those info, locate the new item in the inventory and Voila!

This might not be the best way, but work perfectly for my purpose, might work for you to.
Send me a PM if you need more info, i'll do what i can to help you.

/hat
Hey All,
If you are coding and are testing code, use the Dev tab and codedom. It helps and speeds up coding a LOT,
https://www.thebuddyforum.com/exilebuddy-forum/exilebuddy-guides/164316-dev-tab-runtime-development-using-codedom.html
For hooking and using stuff like moveto and etc, you need to hook the process. Pushedx told me this.

alt + shift + E to enable
the PHM in the client itself
then D for disable, X to toggle the actual cursor lock
I've been using it to test things, and it has substantially speed up a lot of coding work, no more closing eb and restarting as much.
 
Now you face the problem that the item become a new item in memory and you need to find what it become.
I do so by storing a couple of info about the item before to ID it (short name, level, quality, rarity) use all the info that won't change on the item, to be sure to locate it after ID.
Its always enough to save the item's position in inventory. There is no item in poe that will "jump" somewhere upon identification :)
 
Thanks ya'll I got it working as the IDonLoot plugin shows.

Now to play with animate weapon

@DBF, thanks for the insight.. going to try it out now.

wimm
 
Back
Top