From 876c7922b684b1937b8c0b12d70bae07040b33c2 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:17:17 +0200 Subject: [PATCH 01/12] Update index.html --- index.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 2f6ef11..58246ea 100644 --- a/index.html +++ b/index.html @@ -168,7 +168,6 @@ console.log(n); a = new Zlib.Gunzip(n).decompress(); console.log(a); - **/ let a; try { @@ -180,6 +179,17 @@ console.log(a); console.log(decode_utf8(a)); } + **/ + } + + function convertNbtToJson(t) { + try { + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); + nbt.parse(a,function(t,n){if(t)throw t;console.log(n, syntaxHighlight(n))}) + } catch(t) { + console.log("Invalid input: couldn't parse nbt data")}} + function syntaxHighlight(t) { + return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+""})}nbtInputField.onchange=function(){!alreadyParsed&&this.value.length>10&&convertNbtToJson(this.value),alreadyParsed=!1},nbtInputField.onpaste=function(){setTimeout(()=>{alreadyParsed=!0,convertNbtToJson(this.value)},30)},nbtInputField.onfocus=function(){nbtInputField.select()},document.getElementById("nbt-example1").onclick=function(){nbtInputField.value="H4sIAAAAAAAAAB2Q3UrDQBCFZ9uqyRYURO/XB7AohYq9C2tqgqGVxJ9LmTRLunSTLZuttk+U98iDiRsvhoHDnO8chgL4QCQFADKAgSzINYETrve1JRSGFksC4/c6NwK3mCtBhuBHshALhWXjTL8UzgrZ7BQefRgl2gjPqf1MunYWW1GxIJdK2uOcZbX+Ya8K18KwrhVdq9L4OXpjPIn5C9x07UMqy4295UqutwxZrrTbVrNd72EIl+5kepiypge5RGEmLujKqVw3du6gs/s7xrWs+2q0ax/7jCANPRgtsRJw7qT/FtlGfwsFFC7CgzUYWGtkvrei8fofwDhbrj6/smj1ESYAAzh9wgpL4aDwB8czT/sxAQAA",convertNbtToJson(nbtInputField.value)},document.getElementById("nbt-example2").onclick=function(){nbtInputField.value="H4sIAAAAAAAAANWTPW/bMBCGz86XLQT9SIECbYecp25dMway6jSGrXhoi4zBWTxJjCUxJSm4+kX+H/5hRY9ukaHoFiCAF+L43hF4H75kBDCEno4A4KgPfa16ix4cJaZtfC+CA0/FAQyvteKrigonU78iOFHaPVTUDeFwbiwPRD2G0XZzcVuSR6UV+pKxNrJazMwaHXXoDbySkdBZ0rIL+qUcfCfa1H90+EDOt1aaLMd1zZ+kebrd5NtNlSzSdHEzgMMbqhneiphSoTOqMNXVCsdttmIPEbyc/PSWYu+tXrae3SDwwJs0/jJN4vldOp3P7sbfk9nkG0Afjj9TTQVDqJ/A/X7HzeJcmQDlsGAfLkDb4P+iZqUz3XCAPZN9vGtiTramrBvtCSU+pmuwMy2KrQppF+5a+xIJohCu1FkZSF/Ibsyc4z3bVbcvWf5LGZJcl9z8JdUOPshERm1RetQiN8hkffmjpdUu4NchYAzmvl7Hs8lotC/5nv+HPLemFnK1JpvDSQD/82XDK05Mo7hx8ldrMf+M+cJvEox/LLEEAAA=",convertNbtToJson(nbtInputField.value)};
From 1577a0bee675b10720ec679a432f5c6038af4709 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:18:17 +0200 Subject: [PATCH 02/12] Update nbt.js From cd4d723dc99f978243d32af971cf2684933cafd5 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:21:25 +0200 Subject: [PATCH 03/12] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 58246ea..9134071 100644 --- a/index.html +++ b/index.html @@ -189,7 +189,7 @@ } catch(t) { console.log("Invalid input: couldn't parse nbt data")}} function syntaxHighlight(t) { - return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+""})}nbtInputField.onchange=function(){!alreadyParsed&&this.value.length>10&&convertNbtToJson(this.value),alreadyParsed=!1},nbtInputField.onpaste=function(){setTimeout(()=>{alreadyParsed=!0,convertNbtToJson(this.value)},30)},nbtInputField.onfocus=function(){nbtInputField.select()},document.getElementById("nbt-example1").onclick=function(){nbtInputField.value="H4sIAAAAAAAAAB2Q3UrDQBCFZ9uqyRYURO/XB7AohYq9C2tqgqGVxJ9LmTRLunSTLZuttk+U98iDiRsvhoHDnO8chgL4QCQFADKAgSzINYETrve1JRSGFksC4/c6NwK3mCtBhuBHshALhWXjTL8UzgrZ7BQefRgl2gjPqf1MunYWW1GxIJdK2uOcZbX+Ya8K18KwrhVdq9L4OXpjPIn5C9x07UMqy4295UqutwxZrrTbVrNd72EIl+5kepiypge5RGEmLujKqVw3du6gs/s7xrWs+2q0ax/7jCANPRgtsRJw7qT/FtlGfwsFFC7CgzUYWGtkvrei8fofwDhbrj6/smj1ESYAAzh9wgpL4aDwB8czT/sxAQAA",convertNbtToJson(nbtInputField.value)},document.getElementById("nbt-example2").onclick=function(){nbtInputField.value="H4sIAAAAAAAAANWTPW/bMBCGz86XLQT9SIECbYecp25dMway6jSGrXhoi4zBWTxJjCUxJSm4+kX+H/5hRY9ukaHoFiCAF+L43hF4H75kBDCEno4A4KgPfa16ix4cJaZtfC+CA0/FAQyvteKrigonU78iOFHaPVTUDeFwbiwPRD2G0XZzcVuSR6UV+pKxNrJazMwaHXXoDbySkdBZ0rIL+qUcfCfa1H90+EDOt1aaLMd1zZ+kebrd5NtNlSzSdHEzgMMbqhneiphSoTOqMNXVCsdttmIPEbyc/PSWYu+tXrae3SDwwJs0/jJN4vldOp3P7sbfk9nkG0Afjj9TTQVDqJ/A/X7HzeJcmQDlsGAfLkDb4P+iZqUz3XCAPZN9vGtiTramrBvtCSU+pmuwMy2KrQppF+5a+xIJohCu1FkZSF/Ibsyc4z3bVbcvWf5LGZJcl9z8JdUOPshERm1RetQiN8hkffmjpdUu4NchYAzmvl7Hs8lotC/5nv+HPLemFnK1JpvDSQD/82XDK05Mo7hx8ldrMf+M+cJvEox/LLEEAAA=",convertNbtToJson(nbtInputField.value)}; + return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+""})}
From aff637efe0c6a097468e171d686cbf238170beb4 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:24:16 +0200 Subject: [PATCH 04/12] Update index.html --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 9134071..fbec956 100644 --- a/index.html +++ b/index.html @@ -160,7 +160,8 @@ console.log(alchemy_level); console.log(taming_level); console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); - let t = profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data; + let thisthingy = profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data; + convertNBTtoJson(thisthingy); /**let gzipped = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) console.log(gzipped); From e27a6c3747fdf57a658be5e2d7b6d45551b1876b Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:27:42 +0200 Subject: [PATCH 05/12] Update index.html --- index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.html b/index.html index fbec956..13f95b6 100644 --- a/index.html +++ b/index.html @@ -191,6 +191,8 @@ console.log("Invalid input: couldn't parse nbt data")}} function syntaxHighlight(t) { return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+""})} + } + }
From ec0e979c06b7b6da49a0dcc9a3e3ab784de96f37 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:30:35 +0200 Subject: [PATCH 06/12] Update index.html --- index.html | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 13f95b6..158a3b9 100644 --- a/index.html +++ b/index.html @@ -181,17 +181,16 @@ console.log(decode_utf8(a)); } **/ - } + } - function convertNbtToJson(t) { - try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); - nbt.parse(a,function(t,n){if(t)throw t;console.log(n, syntaxHighlight(n))}) - } catch(t) { - console.log("Invalid input: couldn't parse nbt data")}} - function syntaxHighlight(t) { - return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+""})} - } + function convertNbtToJson(t) { + try { + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); + nbt.parse(a,function(t,n){if(t)throw t;console.log(n, syntaxHighlight(n))}) + } catch(t) { + console.log("Invalid input: couldn't parse nbt data")}} + function syntaxHighlight(t) { + return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+""})} } From 088da6467ece42ebdbcfb96eeae0380c56b71350 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:33:48 +0200 Subject: [PATCH 07/12] Update index.html --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 158a3b9..6048b67 100644 --- a/index.html +++ b/index.html @@ -190,7 +190,8 @@ } catch(t) { console.log("Invalid input: couldn't parse nbt data")}} function syntaxHighlight(t) { - return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+""})} + return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+"" + }) } From 20b35e7cccb686c315b7d9112c4b987239a7cc3b Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:34:37 +0200 Subject: [PATCH 08/12] Update index.html --- index.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 6048b67..6cbeb4f 100644 --- a/index.html +++ b/index.html @@ -137,6 +137,17 @@ return decodedMessage; } + function convertNbtToJson(t) { + try { + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); + nbt.parse(a,function(t,n){if(t)throw t;console.log(n, syntaxHighlight(n))}) + } catch(t) { + console.log("Invalid input: couldn't parse nbt data")}} + function syntaxHighlight(t) { + return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+"" + }) + } + async function getStats(username, key, uuid, uuidjson, profilenum, profilejson) { let skyblockskill = await fetch("https://api.hypixel.net/resources/skyblock/skills"); let skillsjson = await skyblockskill.json(); @@ -182,17 +193,6 @@ } **/ } - - function convertNbtToJson(t) { - try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); - nbt.parse(a,function(t,n){if(t)throw t;console.log(n, syntaxHighlight(n))}) - } catch(t) { - console.log("Invalid input: couldn't parse nbt data")}} - function syntaxHighlight(t) { - return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+"" - }) - }
From 012628a1533edcfa2f8473d72d50b0840593382e Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:35:53 +0200 Subject: [PATCH 09/12] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 6cbeb4f..f67ce00 100644 --- a/index.html +++ b/index.html @@ -172,7 +172,7 @@ console.log(taming_level); console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); let thisthingy = profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data; - convertNBTtoJson(thisthingy); + convertNbtToJson(thisthingy); /**let gzipped = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) console.log(gzipped); From 44165e234de7346327069805490732faa978735c Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:39:19 +0200 Subject: [PATCH 10/12] Update index.html --- index.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index f67ce00..458fcc7 100644 --- a/index.html +++ b/index.html @@ -138,14 +138,12 @@ } function convertNbtToJson(t) { - try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); - nbt.parse(a,function(t,n){if(t)throw t;console.log(n, syntaxHighlight(n))}) - } catch(t) { - console.log("Invalid input: couldn't parse nbt data")}} - function syntaxHighlight(t) { - return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),''+t+"" - }) + try { + const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); + nbt.parse(a,function(t,n){if(t)throw t;console.log(n)}) + } catch(t) { + console.log("Invalid input: couldn't parse nbt data"); + } } async function getStats(username, key, uuid, uuidjson, profilenum, profilejson) { From f91455707787c273ae69ef8be6bd91c571e9ec80 Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 05:45:44 +0200 Subject: [PATCH 11/12] Update index.html --- index.html | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 458fcc7..2df79a4 100644 --- a/index.html +++ b/index.html @@ -140,7 +140,7 @@ function convertNbtToJson(t) { try { const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); - nbt.parse(a,function(t,n){if(t)throw t;console.log(n)}) + nbt.parse(a,function(t,n){if(t)throw t;return(n)}) } catch(t) { console.log("Invalid input: couldn't parse nbt data"); } @@ -169,28 +169,11 @@ console.log(alchemy_level); console.log(taming_level); console.log(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data); - let thisthingy = profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data; - convertNbtToJson(thisthingy); + let nbtinventory = profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data; + let json_inventory = convertNbtToJson(nbtinventory); - /**let gzipped = atob(profilejson.profiles[profilenum].members["4a13f41bf0c84dd1a068d57c0c3745c5"].inv_contents.data) - console.log(gzipped); - let n = Uint8Array.from(inventoryunbase64) - console.log(n); - a = new Zlib.Gunzip(n).decompress(); - console.log(a); - - let a; - try { - const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)); - a = new Zlib.Gunzip(n).decompress(); - } catch(error) { - console.error(error); - } - console.log(a); - console.log(decode_utf8(a)); + console.log(json_inventory); } - **/ - }
From 1622e73c80e1e549c553de434d244210cc22605d Mon Sep 17 00:00:00 2001 From: TheTrueShaman <68354378+The-Shaman@users.noreply.github.com> Date: Fri, 22 Oct 2021 18:06:02 +0200 Subject: [PATCH 12/12] Update index.html --- index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 2df79a4..3d3f145 100644 --- a/index.html +++ b/index.html @@ -138,12 +138,14 @@ } function convertNbtToJson(t) { + let data; try { const n=Uint8Array.from(atob(t),t=>t.charCodeAt(0)),a=new Zlib.Gunzip(n).decompress(); - nbt.parse(a,function(t,n){if(t)throw t;return(n)}) + nbt.parse(a,function(t,n){if(t)throw t;data=n}) } catch(t) { console.log("Invalid input: couldn't parse nbt data"); } + return data; } async function getStats(username, key, uuid, uuidjson, profilenum, profilejson) {