aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-09-04 10:21:08 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-09-04 10:21:08 +0800
commit96f5936ef52870a5255d44f5caa22994e0a17862 (patch)
treeb5ec064560c4ea89a608b27c85e521e97c581d50
parentd4f73de27c61c204e0f8d94cf8194c14e85612b0 (diff)
downloadSoopyV2-96f5936ef52870a5255d44f5caa22994e0a17862.tar.gz
SoopyV2-96f5936ef52870a5255d44f5caa22994e0a17862.tar.bz2
SoopyV2-96f5936ef52870a5255d44f5caa22994e0a17862.zip
+ detailed price + meta
-rw-r--r--features/globalSettings/index.js23
-rw-r--r--metadata.json4
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",