diff options
-rw-r--r-- | features/globalSettings/index.js | 23 | ||||
-rw-r--r-- | metadata.json | 4 |
2 files changed, 25 insertions, 2 deletions
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index 8372c58..3a211f4 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -360,6 +360,29 @@ class GlobalSettings extends Feature { }) }) }) + + this.registerCommand("price", () => { + + fetch("http://soopy.dev/api/soopyv2/itemPriceDetailed", { + postData: { + item: Player.getHeldItem().getNBT().toObject() + } + }).json(json => { + ChatLib.chat(this.FeatureManager.messagePrefix + "PRICE ANALASIS:") + json.details.sort((a, b) => { + if (typeof (a) === "string") return 1 + if (typeof (b) === "string") return -1 + return a[1] - b[1] + }).forEach(d => { + if (typeof (d) === "string") { + ChatLib.chat(d) + } else { + ChatLib.chat("&f" + d[0] + "&7: &6" + numberWithCommas(Math.round(d[1]))) + } + }) + ChatLib.chat(this.FeatureManager.messagePrefix + "Final price: " + numberWithCommas(Math.round(json.price))) + }) + }) } worldLoad() { diff --git a/metadata.json b/metadata.json index a93473c..e610eed 100644 --- a/metadata.json +++ b/metadata.json @@ -5,8 +5,8 @@ "entry": "index.js", "description": "SoopyV2", "name": "SoopyV2", - "version": "2.1.147", - "versionId": 274, + "version": "2.1.148", + "versionId": 275, "requires": [ "soopyApis", "soopyAddonsData", |