MercuryTrade-Community-Fork
MercuryTrade-Community-Fork copied to clipboard
[FEATURE REQUEST] - add name automatically
There are two things to add:
- Two optional input fields named account name and POESESSID.
- A HTTP request.
You can access ones public character list with https://www.pathofexile.com/character-window/get-characters?accountName=
and a private character list with an additional POESESSID cookie.
How I imagine it to work:
When you save after inputting your account name you do an initial HTTP request and if you get error "code: 6" prompt a message that the account is set private and you need to add a POESESSID.
After that I would suggest doing a HTTP request after every start checking if the character list can be accessed and if not then do a prompt about the issue
Additionally I would suggest adding a listener to when someone changes global chat and trade chat within 5 seconds as that usually only happens when someone joins with a character (is language depending!).
To know which character is the currently logged in you simply need to filter for the one which is lastActive: true
and get the name.
I came up with another method which is a little bit more manual but doesn't require a HTTP request:
Add a button which sends a random string in the local chat. Use that random string to determine the current character's name.
wont be longer needed since after next update leave function will be changed