Skip to content

Instantly share code, notes, and snippets.

@pushedx
Created January 25, 2016 13:17
Show Gist options
  • Save pushedx/bdbe72ff2ffc90f2d37d to your computer and use it in GitHub Desktop.
Save pushedx/bdbe72ff2ffc90f2d37d to your computer and use it in GitHub Desktop.
_taskManager.Add(new SellTask(NeedsToSell, SellingComplete, ShouldAcceptSellOffer, ShouldSellItem));
private bool ShouldSellItem(Item item, object user)
{
IItemFilter filter;
if (!ItemEvaluator.Match(item, EvaluationType.Save, out filter))
{
if (ItemEvaluator.Match(item, EvaluationType.Sell, out filter))
{
return true;
}
else
{
}
}
else
{
}
return false;
}
private bool NeedsToSell()
{
if (
LokiPoe.InGameState.InventoryPanel.Main.Where(i => i.Rarity != Rarity.Quest)
.Any(i => ShouldSellItem(i, null)))
{
return true;
}
return false;
}
private bool ShouldAcceptSellOffer()
{
Log.DebugFormat("[ShouldAcceptSellOffer] The npc is offering us:");
foreach (var item in LokiPoe.InGameState.SellPanel.NpcOffer)
{
Log.DebugFormat(" {1}x {0}", item.FullName, item.StackCount);
}
return true;
}
private void SellingComplete()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment