Since there is a AutoPassives plugin I thought it would be cool to add the ability to parse the PoE skilltree URLs.
Example: https://www.pathofexile.com/passive-skill-tree/AAAAAwEAJSddSXuM
AAAAAwEAJSddSXuM is basically base64 encoded.
The javascript code processing that stuff on the site is:
I converted it to some basic C#
In some cases some replace is needed for valid base64 strings. Ex:
So decodeSkillTreeURL("AAAAAwEAJSddSXuM"); would result in an array like this: [9511, 23881, 31628] which should be the skill node Ids right?
Maybe this is usefull and one might implement it into the ExileBuddy AutoPassives Plugin, which would make life easier to use the plugin i guess.
Example: https://www.pathofexile.com/passive-skill-tree/AAAAAwEAJSddSXuM
AAAAAwEAJSddSXuM is basically base64 encoded.
The javascript code processing that stuff on the site is:
Code:
var s = new v;
s.setDataString(t);
var o = s.readInt()
, u = s.readInt8()
, a = 0;
o > 0 && (a = s.readInt8());
if (o != T.CurrentVersion) {
alert("The build you are trying to load is using an old version of the passive tree and will not work.");
return
}
var f = [];
while (s.hasData())
f.push(s.readInt16());
this.loadCharacterData(u, f),
a == 1 && this.toggleFullScreen(!0)
I converted it to some basic C#
Code:
static int[] decodeSkillTreeURL(string urlPart)
{
List<int> skills = new List<int>();
BinaryReader reader = new BinaryReader(new MemoryStream(Convert.FromBase64String(urlPart)));
int skillTreeVersion = bytesToInt(reader.ReadBytes(4));
int u = bytesToInt(reader.ReadBytes(1), 1);
int a = 0;
if(skillTreeVersion > 0)
{
a = bytesToInt(reader.ReadBytes(1), 1);
}
while (reader.BaseStream.Position != reader.BaseStream.Length)
{
skills.Add(bytesToInt(reader.ReadBytes(2), 2));
}
return skills.ToArray();
}
static int bytesToInt(byte[] e, int t = 4)
{
int n = 0;
for (int r = 0; r < t; ++r)
{
n += e[r];
if (r < t - 1)
{
n <<= 8;
}
}
return n;
}
In some cases some replace is needed for valid base64 strings. Ex:
Code:
string skillURL = "AAAAAwEABLMFLQU8B3UJlgm7DjwUIBRxFm8XLxiRGekaOCE0IVUkqicLJyAnLyz7Nuk5DjpSOtg7OzwFQKBBP0a3R35IeEnVUEdR5lXWV1RZ814TXz9gkWDEYVJk52VNZlRmnmhlaPJyD3KpdO12f3asd1N673uMfNl-4ICkggeCm4O2hMSE2YTvhVKGYIbRh2qKIoqzkFWQbJOolG-XeZo7nleexZ_fogCpJ6mUrKqtjbQvvJ-9Nr6nwGbApsRYxVPPftNv2WHZfNrB3DLcPeNq5FHkreoY6wnsOO8O707vfPAf82_z3fZI9zL46_rS";
skillURL = skillURL.Replace('-', '+').Replace('_', '/');
decodeSkillTreeURL(skillURL);
So decodeSkillTreeURL("AAAAAwEAJSddSXuM"); would result in an array like this: [9511, 23881, 31628] which should be the skill node Ids right?
Maybe this is usefull and one might implement it into the ExileBuddy AutoPassives Plugin, which would make life easier to use the plugin i guess.
Last edited: