-
Code:
GameController.Game.IngameState.ServerData.StashPanel.IsVisible == true
If I did not reply to you, it mean the question you are asking is stupid.
-
Post Thanks / Like - 2 Thanks
-
★ Elder ★
Originally Posted by
Preaches
I'm trying to make a stash sorter, and I'm having a hard time finding the best way to detect whether or not the stash is opened, right now I'm using
OpenLeftPanel.IsVisible, but that doesn't seem to have the purpose I thought it would have.
Code:
public override void Render()
{
if (!GameController.Game.IngameState.IngameUi.OpenLeftPanel.IsVisible &&
!GameController.Game.IngameState.IngameUi.InventoryPanel.IsVisible &&
!GameController.Area.CurrentArea.IsHideout &&
!GameController.Area.CurrentArea.IsTown)
{
return;
}
Graphics.DrawText("VI VON ZULUL", 50, new Vector2(500, 500), Color.AliceBlue, FontDrawFlags.Center);
}
With the following code the text is drawn to the screen, while in a city and with the inventory opened
but not with the stash open! Which means that
Code:
!GameController.Game.IngameState.IngameUi.OpenLeftPanel.IsVisible == true
How would one go about doing this in a smarter way?
Attachment 52772
Your logic is all kinds of wonky. Not in town and not in hideout should be grouped together with an or operator, or else when you're in town and not in your hideout you won't return, and you'll do the draw. So like this:
Code:
public override void Render()
{
if (!GameController.Game.IngameState.IngameUi.OpenLeftPanel.IsVisible &&
!GameController.Game.IngameState.IngameUi.InventoryPanel.IsVisible &&
(!GameController.Area.CurrentArea.IsHideout ||
!GameController.Area.CurrentArea.IsTown))
{
return;
}
Graphics.DrawText("VI VON ZULUL", 50, new Vector2(500, 500), Color.AliceBlue, FontDrawFlags.Center);
}
But as zaafar said, just use the StashPanel. That really should be in UIElements, but some of those things live in both UIElements and ServerData and have never gotten normalized to just being in UIElements.
-
Post Thanks / Like - 2 Thanks
-
Active Member
@TehCheat Thanks, I thought I was too experienced of a programmer to make that kind of mistake, woops.
-
Active Member
Getting stash-tab names.
Another day, another question 
Code:
using PoeHUD.Plugins;
using SharpDX;
namespace StashManager
{
public class StashManager : BasePlugin
{
public override void Render()
{
if (!GameController.Game.IngameState.ServerData.StashPanel.IsVisible)
{
return;
}
var stash = GameController.Game.IngameState.ServerData.StashPanel;
/*
* Not sure whether or not getStashName(tabIndex) is 0 indexed (it probably is), so starting from index 1.
* stash.TotalStashes gives the expected outcome (number of stash-tabs).
*
* By looking at the declaration of getStashName, we can see the following:
*
* public string getStashName(int number)
* {
* if ((long) number >= this.TotalStashes)
* return string.Empty;
*
* long address = this.StashListPanel.Children[2].Children[number].Address;
* string str = this.M.ReadStringU(this.M.ReadLong(address + 1680L, 1488L), 256, 1 != 0);
* if (str.Length == 0)
* return this.M.ReadStringU(this.M.ReadLong(address + 1680L) + 1488L, 256, true);
*
* return str;
* }
*/
for (var i = 1; i < (int) stash.TotalStashes; i++)
{
Graphics.DrawText(stash.getStashName(i), 50, new Vector2(20 * i, 500), Color.AliceBlue);
}
}
}
}
I tested each segment of the code, but no matter what parameter I specify for getStashName(int number) I get an index out of bounds exception.
From ErrorLog.txt:
Code:
Method error: Render : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
How would one go about getting stashNames or Inventorylist from a stash-tab?
Last edited by Preaches; 05-02-2017 at 09:53 AM.
-
Member
hi, this tool can atlert detonate dead mobs?
-
★ Elder ★
Originally Posted by
StevenT
hi, this tool can atlert detonate dead mobs?
Not currently. It would have to be altered to handle mob skills.
-
Post Thanks / Like - 1 Thanks
StevenT (1 members gave Thanks to TehCheat for this useful post)
-
★ Elder ★
Originally Posted by
Preaches
Another day, another question
How would one go about getting stashNames or Inventorylist from a stash-tab?
I'd debug it to see when it's failing. You could pop a messagebox up with the value of i and see when it fails.
-
Post Thanks / Like - 1 Thanks
toadskin (1 members gave Thanks to TehCheat for this useful post)
-
Originally Posted by
Preaches
Another day, another question

How would one go about getting stashNames or Inventorylist from a stash-tab?
When using this, your stashe must be opened.
Also, it start from 0 not 1.
Also, open all stashes at least once so that poe client can get stash data from the server.
If I did not reply to you, it mean the question you are asking is stupid.
-
Post Thanks / Like - 1 Thanks
toadskin (1 members gave Thanks to GameHelper for this useful post)
-
★ Elder ★
Originally Posted by
zaafar
When using this, your stashe must be opened.
Also, it start from 0 not 1.
Also, open all stashes at least once so that poe client can get stash data from the server.
I had a feeling that's what he was running into, which is why I suggested debugging it one tab at a time. It should load the first 5 tabs automatically when you go in hideout/town and the rest have to manually be opened or the data isn't available. I don't know why I'm telling you this, you know it already.
-
★ Elder ★
Originally Posted by
Evilwookie
anyone else just get banned?
Seems to just be you. Any info on what 3rd party tools you were using and behavior that you were using. Mind you, it could have been from the past, so anything recent would be enlightening.
-
Originally Posted by
TehCheat
I had a feeling that's what he was running into, which is why I suggested debugging it one tab at a time. It should load the first 5 tabs automatically when you go in hideout/town and the rest have to manually be opened or the data isn't available. I don't know why I'm telling you this, you know it already.

I think they have changed the behavior, now it doesn't load first 5 tabs when you go in HO/Town.
It only load when you open it. To test this behavior, download some big size movie/torrent or do speed test run and during that time open the stash, u will feel the delay.
If I did not reply to you, it mean the question you are asking is stupid.
-
Active Member
Further testing.
Alright, so I took the suggestion to heart, and did some further testing and came to the conclusion that getStashInventory works as intended, but getStashName does not.
Each of the following tests is called from the Render() function.
Code:
public override void Render()
{
if (!GameController.Game.IngameState.ServerData.StashPanel.IsVisible)
{
return;
}
// called function from here.
}
getStashInventory test.
Code:
private void ShowItemCountOfEachNonNullTab()
{
var stashPanel = GameController.Game.IngameState.ServerData.StashPanel;
var numberOfStashes = (int) stashPanel.TotalStashes; // Why is this not an int? :thinking:
var content = "";
for (var i = 0; i < numberOfStashes; i++)
{
var stashTab = stashPanel.getStashInventory(i);
if (stashTab == null)
{
content += "stash tab no. " + i + ", is null.\n";
continue;
}
var itemCount = stashTab.ItemCount;
content += "stash tab no. " + i + ", has " + itemCount + " items in it.\n";
}
MessageBox.Show(content);
}
Result was for the most part as expected given @TehCheat and @Zafaar's comments.
Notes:
If you visit a new stash (eg. travel to a new town) the memoryaddresses no longer contain the information (getStashPanel from 0 to TotalStashes returns null) and you would have to go through each tab again.
Tab information is stored into memory one at a time (as the client views the tab, not 5):

tested by traveling to a new town and opening the stash
Side note: The first time a stash is opened in a new place, with the code above, even the first tab displays as null, but this is due to not having a delay, by simply waiting a second, and requesting the information again without doing anything in game, we get the correct result from the first stash tab (not null).
getStashName test.
Code:
private void ShowItemCountOfEachNonNullTab()
{
var stashPanel = GameController.Game.IngameState.ServerData.StashPanel;
var numberOfStashes = (int) stashPanel.TotalStashes;
var content = "";
for (var i = 0; i < numberOfStashes; i++)
{
var stashTab = stashPanel.getStashInventory(i);
if (stashTab == null)
{
content += "stash tab no. " + i + ", is null.\n";
continue;
}
var itemCount = stashTab.ItemCount;
content += "stash tab no. " + i + ", has " + itemCount + " items in it.\n";
}
MessageBox.Show(content);
}
Messagebox never get's called here, since we get the following error for each value of i:
Code:
Method error: Render : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
But since we are using the same index range as in the getStashInventory test this is odd, and I think it should get looken into. 
UPDATE
Made a new test, that kinda works:

The code is checking if all stashes are not null, if they are, it views them all by pressing right keyboard arrow and then left back to it's original position, and then the following is executed:
Code:
for (var i = 0; i < stashPanel.TotalStashes; i++)
{
var titleElement = stashPanel.getStashTitleElement(stashPanel.getStashName(i));
var position = titleElement.GetClientRect();
Graphics.DrawText(stashPanel.getStashName(i), 20, new Vector2(position.X, position.Y));
}
UPDATE 2
Code works on Zafaar's end, dunno.
Last edited by Preaches; 05-04-2017 at 03:52 AM.
-
Post Thanks / Like - 1 Thanks
toadskin (1 members gave Thanks to Preaches for this useful post)
-
Member
Originally Posted by
TehCheat
Seems to just be you. Any info on what 3rd party tools you were using and behavior that you were using. Mind you, it could have been from the past, so anything recent would be enlightening.
Could it have been my autoclicker usage?
-
Will look into getStashName function.
Thx for the research work.
If I did not reply to you, it mean the question you are asking is stupid.
-
Member
I have problem with itemfilter. Every item is linked as rare or something it shows in right side of screen with my new character i have made. Other characters dont show this and are absolutely fine. What went wrong?