v0.13.7 - Channeling prioritized before buff priority loop

- Moved findBestChannelingTarget() BEFORE the BUFF_PRIORITY loop
- When Q is pressed and channeling is active, the script now picks the most
  expensive buff for the channeling charge instead of wasting it on the
  first buff in priority order (Haste at 32 MP instead of Heartseeker at 175)
- Reverted the vitals auto-execute (Q-key workflow, not auto-battle)
- All three tiers: channeling check fires after castInitialBuffs but
  before the regular shouldBuff loop
This commit is contained in:
GaboGG 2026-07-26 13:27:24 -04:00
parent 28a13449bd
commit bbf7c95fb9
4 changed files with 45 additions and 15 deletions

View file

@ -969,6 +969,11 @@ function strategyNovice() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;
@ -1084,6 +1089,11 @@ function strategyAdept() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;
@ -1212,6 +1222,11 @@ function strategyVeteran() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;
@ -3269,11 +3284,6 @@ function initializeBattle() {
const vobs = new MutationObserver(() => {
parseBattleState();
logRound(); // Also log on vitals changes (catches end-of-round)
// Auto-execute strategy even without hover — for auto-battle
if (CFG.hoverEnabled && !STATE.interruptHover && !STATE.interruptAlert) {
const a = getSmartAction();
if (a) executeAction(a);
}
refreshUI();
updateConfigButton();
// Check if battle ended (completion pane appeared)

View file

@ -969,6 +969,11 @@ function strategyNovice() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;
@ -1084,6 +1089,11 @@ function strategyAdept() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;
@ -1212,6 +1222,11 @@ function strategyVeteran() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;
@ -3269,11 +3284,6 @@ function initializeBattle() {
const vobs = new MutationObserver(() => {
parseBattleState();
logRound(); // Also log on vitals changes (catches end-of-round)
// Auto-execute strategy even without hover — for auto-battle
if (CFG.hoverEnabled && !STATE.interruptHover && !STATE.interruptAlert) {
const a = getSmartAction();
if (a) executeAction(a);
}
refreshUI();
updateConfigButton();
// Check if battle ended (completion pane appeared)

View file

@ -85,11 +85,6 @@ function initializeBattle() {
const vobs = new MutationObserver(() => {
parseBattleState();
logRound(); // Also log on vitals changes (catches end-of-round)
// Auto-execute strategy even without hover — for auto-battle
if (CFG.hoverEnabled && !STATE.interruptHover && !STATE.interruptAlert) {
const a = getSmartAction();
if (a) executeAction(a);
}
refreshUI();
updateConfigButton();
// Check if battle ended (completion pane appeared)

View file

@ -321,6 +321,11 @@ function strategyNovice() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;
@ -436,6 +441,11 @@ function strategyAdept() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;
@ -564,6 +574,11 @@ function strategyVeteran() {
const ib = castInitialBuffs();
if (ib) return ib;
}
// If channeling is active, prioritize most expensive buff for best value
if (STATE.channeling && STATE.mp > 0.10) {
const ch = findBestChannelingTarget();
if (ch) return ch;
}
for (const b of BUFF_PRIORITY) {
if (shouldBuff(b.icon, b.minTurns) && STATE.mp > 0.2 && hasSpell(b.spell)) {
if (b.icon === 'regen' && STATE.hp >= CFG.cureRegenHP) continue;