Skip to content

Commit

Permalink
- Made memorizing spells a bit more resiliant
Browse files Browse the repository at this point in the history
- pull now gives more info if someone is out of range
  • Loading branch information
DerpleMQ2 committed Feb 24, 2024
1 parent 05995fe commit 9223182
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions modules/pull.lua
Original file line number Diff line number Diff line change
Expand Up @@ -758,13 +758,17 @@ function Module:CheckGroupForPull(classes, resourceStartPct, resourceStopPct, ca
if RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY) > math.max(RGMercConfig.SubModuleSettings.Movement.settings.AutoCampRadius, 50) then
RGMercUtils.PrintGroupMessage("%s is too far away - Holding pulls!", member.CleanName())
return false,
string.format("%s Too Far (%d)", member.CleanName(), RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY))
string.format("%s Too Far (%d) (%d,%d) (%d,%d)", member.CleanName(),
RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY), member.X(), member.Y(), campData.AutoCampX,
campData.AutoCampY)
end
else
if (member.Distance() or 0) > math.max(RGMercConfig.SubModuleSettings.Movement.settings.AutoCampRadius, 80) then
RGMercUtils.PrintGroupMessage("%s is too far away - Holding pulls!", member.CleanName())
return false,
string.format("%s Too Far (%d)", member.CleanName(), RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY))
string.format("%s Too Far (%d) (%d,%d) (%d,%d)", member.CleanName(),
RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY), member.X(), member.Y(), campData.AutoCampX,
campData.AutoCampY)
end
end

Expand Down
4 changes: 2 additions & 2 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ function Utils.MemorizeSpell(gem, spell, maxWait)
RGMercsLogger.log_info("\ag Meming \aw %s in \ag slot %d", spell, gem)
Utils.DoCmd("/memspell %d \"%s\"", gem, spell)

while mq.TLO.Me.Gem(gem)() ~= spell and maxWait > 0 do
while (mq.TLO.Me.Gem(gem)() ~= spell or not mq.TLO.Me.SpellReady(gem)()) and maxWait > 0 do
RGMercsLogger.log_verbose("\ayWaiting for '%s' to load in slot %d'...", spell, gem)
mq.delay(100)
maxWait = maxWait - 100
Expand Down Expand Up @@ -971,7 +971,7 @@ function Utils.UseSpell(spellName, targetId, bAllowMem)
local spellRequiredMem = false
if not me.Gem(spellName)() then
RGMercsLogger.log_debug("\ay%s is not memorized - meming!", spellName)
Utils.MemorizeSpell(Utils.UseGem, spellName, 15000)
Utils.MemorizeSpell(Utils.UseGem, spellName, 25000)
spellRequiredMem = true
end

Expand Down

0 comments on commit 9223182

Please sign in to comment.