For example, can I assign all currency in 1 tab, and everything else in the rest? Don't think it's the item filter editor, but would like to know if it's possible.
Yea it is, you would need a plugin for that
plugin needs to be an Itask and added before stashing tab.
Plugin would handle the tabs management and where things go.
I'll get you an example soon, as i'm doing something similar.
Called when stashing is completed, so you can change bot state to signal you don't need to stash anymore (BasicGrindBot uses this).
Code:
private void StashingComplete()
{
}
Called to determine the best stash tab for an item. Please read the comments.
Code:
private bool BestStashTabForItem(InventoryTab tab, Inventory inventory, Item item, object user)
{
// This function allows users to force items into specific tabs. However, stashing will fail
// if no tab is matched, so logic needs to handle being able to stash in fallback tabs if the
//desired tab is full.
//var name = item.FullName;
// This tab holds junk currency
/*if (tab.DisplayName == "Junk Currency")
{
if (name == "Armourer's Scrap" ||
name == "Orb of Augmentation" ||
name == "Orb of Chance" ||
name == "Orb of Transmutation" ||
name == "Blacksmith's Whetstone" ||
name == "Glassblower's Bauble")
{
return true;
}
return false;
}
// This tab holds valuable currency.
if (tab.DisplayName == "Valuable Currency")
{
if (item.IsCurrencyType)
{
// Exclude these currency items.
if (name == "Orb of Augmentation" ||
name == "Orb of Chance" ||
name == "Orb of Transmutation" ||
name == "Blacksmith's Whetstone" ||
name == "Glassblower's Bauble" ||
name == "Scroll of Wisdom" ||
name == "Portal Scroll" ||
name == "Orb of Alteration")
{
return false;
}
// Take everything else.
return true;
}
return false;
}
// This tab only holds alts.
if (tab.DisplayName == "Alterations")
{
return name == "Orb of Alteration";
}
// This tab only holds scrolls.
if (tab.DisplayName == "Scrolls")
{
return name == "Scroll of Wisdom" || name == "Portal Scroll";
}*/
return true;
}
Determines which items should get stashed.
Code:
private bool ShouldStashItem(Item item, object user)
{
// The default logic stashes everything. Add in custom handling to not stash
// id, tp, maps, etc...
return true;
}
Here is the current implementations of BasicGrindBot's stashing functions, if you wish to keep various features provided when replacing the tasks:
Code:
private bool NeedsToStash()
{
if (!BasicGrindBotSettings.Instance.NeedsToStash)
{
if (BasicGrindBotSettings.Instance.EnableStashingOnFreeSpacePercent)
{
if (LokiPoe.InGameState.InventoryPanel.MainInventory.InventorySpacePercent >
BasicGrindBotSettings.Instance.FreeSpaceToTriggerStashingPercent)
{
return false;
}
}
}
if (
!LokiPoe.InGameState.InventoryPanel.Main.Where(i => i.Rarity != Rarity.Quest)
.Any(i => ShouldStashItem(i, null)))
{
return false;
}
return true;
}
private void StashingComplete()
{
BasicGrindBotSettings.Instance.NeedsToStash = false;
}
private bool BestStashTabForItem(InventoryTab tab, Inventory inventory, Item item, object user)
{
return true;
}
private bool ShouldStashItem(Item item, object user)
{
var name = item.FullName;
if (name == "Scroll of Wisdom")
{
if (BasicGrindBotSettings.Instance.DontStashIdScrolls)
{
if (
LokiPoe.InGameState.InventoryPanel.MainInventory.GetTotalItemStacksByFullName(name) ==
1)
{
return false;
}
var bestItem =
LokiPoe.InGameState.InventoryPanel.Main.Where(i => i.FullName == name)
.OrderByDescending(i => i.StackCount)
.ThenBy(i => i.BaseAddress.ToInt32())
.First();
if (bestItem.BaseAddress == item.BaseAddress)
return false;
}
}
else if (name == "Portal Scroll")
{
if (BasicGrindBotSettings.Instance.DontStashTpScrolls)
{
if (
LokiPoe.InGameState.InventoryPanel.MainInventory.GetTotalItemStacksByFullName(name) ==
1)
{
return false;
}
var bestItem =
LokiPoe.InGameState.InventoryPanel.Main.Where(i => i.FullName == name)
.OrderByDescending(i => i.StackCount)
.ThenBy(i => i.BaseAddress.ToInt32())
.First();
if (bestItem.BaseAddress == item.BaseAddress)
return false;
}
}
else if (name == "Alchemy Shard")
{
if (BasicGrindBotSettings.Instance.DontStashAlchemyShards)
{
return false;
}
}
else if (name == "Transmutation Shard")
{
if (BasicGrindBotSettings.Instance.DontStashTransmutationShards)
{
return false;
}
}
else if (name == "Alteration Shard")
{
if (BasicGrindBotSettings.Instance.DontStashAlterationShards)
{
return false;
}
}
else if (name == "Scroll Fragment")
{
if (BasicGrindBotSettings.Instance.DontStashScrollFragments)
{
return false;
}
}
return true;
}
So, you'd:
1. Make a new plugin to hold the code (see Guides section for reference).
2. Copy and paste the BasicGrindBot functions into that plugin so you keep bot functionality.
3. Modify the functions as needed for your logic.
4. In your plugin's Start function, you'd add the following code to replace the default task:
Code:
TaskManager.Replace("StashTask", new StashTask(NeedsToStash, StashingComplete, ShouldStashItem, BestStashTabForItem));
If all goes well, you should be able to enable and test right away with some controlled items in your inventory.
In the future, I would like to have stash tab logic integrated into a new item filter system, but for now, we need things to stay stable and working, so this is the alternative as otherwise the entire item filter system and API has to change.