Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 1, 2024
1 parent 4bdc50a commit 0ac6287
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion modules/movement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ end
function Module:DestoryCampfire()
mq.TLO.Window("FellowshipWnd").DoOpen()
mq.delay("3s", mq.TLO.Window("FellowshipWnd").Open())
---@diagnostic disable-next-line: undefined-field
mq.TLO.Window("FellowshipWnd").Child("FP_Subwindows").SetCurrentTab(2)

if mq.TLO.Me.Fellowship.Campfire() then
Expand Down Expand Up @@ -165,6 +166,7 @@ function Module:Campfire(camptype)
for i = 1, spawnCount do
local spawn = mq.TLO.NearestSpawn(i, "PC radius 50")

---@diagnostic disable-next-line: redundant-parameter
if spawn() and mq.TLO.Me.Fellowship.Member(spawn.CleanName()) then
fellowCount = fellowCount + 1
end
Expand All @@ -173,6 +175,7 @@ function Module:Campfire(camptype)
if fellowCount >= 3 then
mq.TLO.Window("FellowshipWnd").DoOpen()
mq.delay("3s", mq.TLO.Window("FellowshipWnd").Open())
---@diagnostic disable-next-line: undefined-field
mq.TLO.Window("FellowshipWnd").Child("FP_Subwindows").SetCurrentTab(2)

if mq.TLO.Me.Fellowship.Campfire() then
Expand All @@ -190,6 +193,7 @@ function Module:Campfire(camptype)

mq.TLO.Window("FellowshipWnd").Child("FP_RefreshList").LeftMouseUp()
mq.delay("1s")
---@diagnostic disable-next-line: redundant-parameter
mq.TLO.Window("FellowshipWnd").Child("FP_CampsiteKitList").Select(self.settings.MaintainCampfire or camptype)
mq.delay("1s")
mq.TLO.Window("FellowshipWnd").Child("FP_CreateCampsite").LeftMouseUp()
Expand Down Expand Up @@ -327,6 +331,7 @@ function Module:GiveTime(combat_state)
if mq.TLO.Me.Dead() then return end
if not chaseSpawn() or chaseSpawn.Distance() < self.settings.ChaseDistance then return end

---@diagnostic disable-next-line: undefined-field
local Nav = mq.TLO.Nav

-- Use MQ2Nav with moveto as a failover if we have a mesh. We'll use a nav
Expand All @@ -344,7 +349,7 @@ function Module:GiveTime(combat_state)
mq.cmdf("/squelch /moveto id %d uw mdist %d", chaseSpawn.ID(), self.settings.ChaseDistance)
end
end
elseif chaseSpawn.Distance() > self.settings.ChaseDistance and chaseSpawn.Distnance() < 400 then
elseif chaseSpawn.Distance() > self.settings.ChaseDistance and chaseSpawn.Distance() < 400 then
-- If we don't have a mesh we're using afollow as legacy RG behavior.
mq.cmdf("/squelch /afollow spawn %d", chaseSpawn.ID())
mq.cmdf("/squelch /afollow %d", self.settings.ChaseDistance)
Expand Down
13 changes: 13 additions & 0 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function Utils.HandleDeath()

while mq.TLO.Me.Hovering() do
if mq.TLO.Window("RespawnWnd").Open() and RGMercConfig:GetSettings().InstantRelease then
---@diagnostic disable-next-line: redundant-parameter
mq.TLO.Window("RespawnWnd").Child("RW_OptionsList").Select(1)
mq.delay("1s")
mq.TLO.Window("RespawnWnd").Child("RW_SelectButton").LeftMouseUp()
Expand All @@ -81,6 +82,7 @@ function Utils.HandleDeath()
end
end

---@diagnostic disable-next-line: undefined-field
mq.delay("1m", (not mq.TLO.Me.Zoning()))

if RGMercConfig:GetSettings().DoFellow then
Expand Down Expand Up @@ -183,6 +185,7 @@ function Utils.GetBestSpell(t)
end

if selectedSpell then
---@diagnostic disable-next-line: undefined-field
RGMercsLogger.log_debug("\agFound\ax %s level(%d) rank(%s)", selectedSpell.BaseName(), selectedSpell.Level(),
selectedSpell.RankName())
else
Expand All @@ -196,6 +199,7 @@ function Utils.WaitCastFinish(target)
local maxWaitOrig = ((mq.TLO.Me.Casting.MyCastTime.TotalSeconds() or 0) + ((mq.TLO.EverQuest.Ping() * 2 / 100) + 1)) * 1000
local maxWait = maxWaitOrig

---@diagnostic disable-next-line: undefined-field
while mq.TLO.Me.Casting() and (not mq.TLO.Cast.Ready()) do
mq.delay(100)
if target() and Utils.GetTargetPctHPs() <= 0 or (Utils.GetTargetID() ~= target.ID()) then
Expand Down Expand Up @@ -674,8 +678,10 @@ function Utils.NavInCombat(config, assistId, targetId, distance, bDontStick)
mq.cmdf("/stick off")
end

---@diagnostic disable-next-line: undefined-field
if mq.TLO.Nav.PathExists("id " .. tostring(targetId) .. " distance " .. tostring(distance))() then
mq.cmdf("/nav id %d distance=%d log=off lineofsight=on", targetId, distance)
---@diagnostic disable-next-line: undefined-field
while mq.TLO.Nav.Active() and mq.TLO.Nav.Velocity() > 0 do
mq.delay(100)
end
Expand Down Expand Up @@ -712,6 +718,7 @@ function Utils.AutoMed()
if me.Class.ShortName():lower() == "brd" and me.Level() > 5 then return end

-- TODO: Add DoMount Check
---@diagnostic disable-next-line: undefined-field
if me.Mount.ID() and not mq.TLO.Zone.Indoor() then
RGMercsLogger.log_verbose("Sit check returning early due to mount.")
return
Expand All @@ -720,6 +727,7 @@ function Utils.AutoMed()
RGMercConfig:StoreLastMove()

--If we're moving/following/navigating/sticking, don't med.
---@diagnostic disable-next-line: undefined-field
if me.Casting() or me.Moving() or mq.TLO.Stick.Active() or mq.TLO.Nav.Active() or mq.TLO.MoveTo.Moving() or mq.TLO.AdvPath.Following() then
RGMercsLogger.log_verbose("Sit check returning early due to movement.")
return
Expand Down Expand Up @@ -817,6 +825,7 @@ function Utils.DoBuffCheck()

if Utils.GetXTHaterCount() > 0 or RGMercConfig.Globals.AutoTargetID > 0 then return false end

---@diagnostic disable-next-line: undefined-field
if (mq.TLO.MoveTo.Moving() or mq.TLO.Me.Moving() or mq.TLO.AdvPath.Following() or mq.TLO.Nav.Active()) and mq.TLO.Me.Class.ShortName():lower() ~= "brd" then return false end

if RGMercConfig.Constants.RGCasters:contains(mq.TLO.Me.Class.ShortName()) and mq.TLO.Me.PctMana() < 10 then return false end
Expand Down Expand Up @@ -853,8 +862,10 @@ function Utils.AutoCampCheck(config, tempConfig)

if distanceToCamp > 5 then
local navTo = string.format("locyxz %d %d %d", tempConfig.AutoCampY, tempConfig.AutoCampX, tempConfig.AutoCampZ)
---@diagnostic disable-next-line: undefined-field
if mq.TLO.Nav.PathExists(navTo)() then
mq.cmdf("/nav %s", navTo)
---@diagnostic disable-next-line: undefined-field
while mq.TLO.Nav.Active() do
mq.delay(10)
mq.doevents()
Expand Down Expand Up @@ -1196,6 +1207,7 @@ function Utils.FindTarget()
RGMercConfig.Globals.AutoTargetID = assistTarget.ID()
end
else
---@diagnostic disable-next-line: undefined-field
RGMercConfig.Globals.AutoTargetID = mq.TLO.Me.GroupAssistTarget() and mq.TLO.Me.GroupAssistTarget.ID() or 0
end
end
Expand Down Expand Up @@ -1556,6 +1568,7 @@ function Utils.RenderRotationTable(s, n, t, map, rotationState)
local mappedAction = map[entry.name]
if mappedAction then
if type(mappedAction) == "userdata" then
---@diagnostic disable-next-line: undefined-field
ImGui.Text(entry.name .. " ==> " .. mappedAction.RankName() or mappedAction.Name())
else
ImGui.Text(entry.name .. " ==> " .. mappedAction)
Expand Down
2 changes: 1 addition & 1 deletion version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = '1da4924 (Removed test file, 2023-12-31)' }
return { commitId = '4bdc50a (Added Config Categories Added code to remove deprecated config options from user config files, 2023-12-31)' }

0 comments on commit 0ac6287

Please sign in to comment.