aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--features/dataLoader/index.js13
-rw-r--r--features/dungeonSolvers/index.js14
2 files changed, 19 insertions, 8 deletions
diff --git a/features/dataLoader/index.js b/features/dataLoader/index.js
index 849e0fd..0553b2a 100644
--- a/features/dataLoader/index.js
+++ b/features/dataLoader/index.js
@@ -24,6 +24,7 @@ class DataLoader extends Feature {
this.registerStep(true, 2, this.step)
this.registerStep(false, 170, this.loadApiStepThing)
+ this.registerStep(false, 60 * 5, this.step_5min)
this.registerEvent("worldLoad", this.worldLoad)
@@ -32,6 +33,8 @@ class DataLoader extends Feature {
this.lastServer = undefined
this.lastSentServer = 0
+ this.currentMayorPerks = new Set()
+
this.loadedApiDatas = {}
this.lastApiData = {
@@ -45,9 +48,19 @@ class DataLoader extends Feature {
this.loadApi()
+ this.step_5min()
+
this.firstLoaded = false
}
+ step_5min() {
+ fetch("http://soopymc.my.to/api/v2/mayor").json(data => {
+ if (!data.success) return
+ this.mayorData = data.data
+ this.currentMayorPerks = new Set(data.data.mayor.perks.map(a => a.name))
+ })
+ }
+
worldLoad() {
this.area = undefined
this.areaFine = undefined
diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js
index 6fba0ab..6454116 100644
--- a/features/dungeonSolvers/index.js
+++ b/features/dungeonSolvers/index.js
@@ -323,15 +323,13 @@ class DungeonSolvers extends Feature {
}
step_5min() {
- fetch("http://soopymc.my.to/api/v2/mayor").json(data => {
- this.ezpz = false
- if (!data.success) return
- if (data.data.mayor.name === "Paul") {
- if (data.data.mayor.perks.some(a => a.name === "EZPZ")) {
- this.ezpz = true
- }
+ this.ezpz = false
+ if (!data.success) return
+ if (this.FeatureManager.features["dataLoader"].class.mayorData.mayor.name === "Paul") {
+ if (this.FeatureManager.features["dataLoader"].class.currentMayorPerks.has("EZPZ")) {
+ this.ezpz = true
}
- })
+ }
}
calculateDungeonScore() {