diff options
Diffstat (limited to 'features')
| -rw-r--r-- | features/globalSettings/index.js | 23 |
1 files changed, 23 insertions, 0 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() { |
