First: I might just make a thread called "Help Dgc" rather than spam this subforum so much
On topic:
I'm messing around with some other parts of the API and wanted to make a little bot that would run around to all the vendors looking for chromatics/5 links/6 links/6 sockets. For some reason I'm getting weird results with PurchasePanel.CurrentTabItems. Here is roughly the code I'm using:
I'm having it loop through ever so often to try to eliminate the possibility of having an empty list due to checking too soon. My output is usually:
Once in a while it will pick up on one or two items without much obvious consistency. I've tried several NPCs with no pattern there either.
edit:
Just tried this with my stash:
and that worked fine. So my code isn't completely botched.
On topic:
I'm messing around with some other parts of the API and wanted to make a little bot that would run around to all the vendors looking for chromatics/5 links/6 links/6 sockets. For some reason I'm getting weird results with PurchasePanel.CurrentTabItems. Here is roughly the code I'm using:
Code:
private int tickCount = 0;
private int loopCount = 0;
public void Tick()
{
tickCount++;
if (LokiPoe.InGameState.IsPurchaseWindowOpen && tickCount > loopCount * 200)
{
foreach (var tab in LokiPoe.InGameState.PurchasePanel.Tabs)
{
LokiPoe.InGameState.PurchasePanel.SwitchToTab(tab);
Log.Debug("TickCount: " + tickCount + ", LoopCount: " + loopCount);
Log.Debug("Item Count for panel " + tab + ": " + LokiPoe.InGameState.PurchasePanel.CurrentTabItems.Count);
foreach (var tabItem in LokiPoe.InGameState.PurchasePanel.CurrentTabItems)
{
Log.Debug("--------New Item--------");
Log.Debug("Name: " + tabItem.Item.Name);
Log.Debug("Socket Count: " + tabItem.Item.SocketCount);
Log.Debug("Max Link Count: " + tabItem.Item.MaxLinkCount);
Log.Debug("Is Chromatic: " + tabItem.Item.IsChromatic);
}
}
loopCount++;
}
}
I'm having it loop through ever so often to try to eliminate the possibility of having an empty list due to checking too soon. My output is usually:
Code:
Item Count for panel -2-: 0
TickCount: 1, LoopCount: 0
[ClearAllKeyStates]
Item Count for panel -1-: 0
TickCount: 1, LoopCount: 0
[ClearAllKeyStates]
Item Count for panel -3-: 0
edit:
Just tried this with my stash:
Code:
if (LokiPoe.InGameState.IsStashPanelOpen && tickCount > loopCount * 200)
{
//foreach (var tab in LokiPoe.InGameState.StashPanel.Tabs)
//{
LokiPoe.InGameState.StashPanel.SwitchToTab(LokiPoe.InGameState.StashPanel.CurrentTab.ToString());
Log.Debug("TickCount: " + tickCount + ", LoopCount: " + loopCount);
Log.Debug("Item Count for panel " + LokiPoe.InGameState.StashPanel.CurrentTab + ": " + LokiPoe.InGameState.StashPanel.CurrentTabItems.Count);
foreach (var tabItem in LokiPoe.InGameState.StashPanel.CurrentTabItems)
{
Log.Debug("--------New Item--------");
Log.Debug("Name: " + tabItem.Name);
Log.Debug("Socket Count: " + tabItem.SocketCount);
Log.Debug("Max Link Count: " + tabItem.MaxLinkCount);
Log.Debug("Is Chromatic: " + tabItem.IsChromatic);
}
//}
loopCount++;
}
and that worked fine. So my code isn't completely botched.
Last edited: