diff --git a/modules/other/SunGeckoMacro.js b/modules/other/SunGeckoMacro.js index e092a652..98c55fef 100644 --- a/modules/other/SunGeckoMacro.js +++ b/modules/other/SunGeckoMacro.js @@ -91,6 +91,7 @@ const SUN_GECKO_COMBAT_ORIGIN = { }; const WARP_WIZARD_DELAY_TICKS = 40; +const MINIMUM_MOTES = 5000; class SunGecko extends ModuleBase { constructor() { @@ -135,6 +136,7 @@ class SunGecko extends ModuleBase { this.on('tick', () => { if (!Player.getPlayer()) return; + switch (this.state) { case States.WAITING: break; @@ -167,6 +169,26 @@ class SunGecko extends ModuleBase { OverlayManager.incrementTrackedValue(this.oid, 'essence', essenceAmount); } + getMotesFromScoreboard() { + try { + const lines = Scoreboard.getLines(); + if (!lines) return null; + + for (const line of lines) { + const lineText = ChatLib.removeFormatting(String(line)); + const match = lineText.match(/Motes\s*[:\-]?\s*([\d,]+)/i); + if (!match) continue; + + const motes = Number(match[1].replace(/,/g, '')); + return Number.isFinite(motes) ? motes : null; + } + } catch (e) { + console.error('V5 Caught error' + e + e.stack); + } + + return null; + } + countNearbyBlocks() { const player = Player.getPlayer(); if (!player) return 0; @@ -308,6 +330,11 @@ class SunGecko extends ModuleBase { this.scheduleState(States.DETERMIN, 40); return; } + var motes = this.getMotesFromScoreboard(); + if (motes !== null && motes < MINIMUM_MOTES) { + this.toggle(false); + return; + } if (Guis.guiName() !== null) { this.clickMenuItem(ORUO.menuItem);