Skip to content

Commit

Permalink
DoStickTimer
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 8, 2024
1 parent 97c43ef commit 908376f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extras/version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = '2857068 2024-01-08' }
return { commitId = '97c43ef 2024-01-08' }
14 changes: 12 additions & 2 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Utils.__index = Utils
Utils.Actors = require('actors')
Utils.ScriptName = "RGMercs"
Utils.LastZoneID = 0
Utils.LastDoStick = 0
Utils.NamedList = {}
Utils.ShowDownNamed = false
Utils.Memorizing = false
Expand Down Expand Up @@ -402,8 +403,10 @@ function Utils.UseAA(aaName, targetId)
mq.delay(string.format("%ds", aaAbility.Spell.MyCastTime.TotalSeconds()))
end

RGMercsLogger.log_debug("switching target back to old target after casting aa")
Utils.SetTarget(oldTargetId)
if oldTargetId > 0 then
RGMercsLogger.log_debug("switching target back to old target after casting aa")
Utils.SetTarget(oldTargetId)
end
end

---@param itemName string
Expand Down Expand Up @@ -960,6 +963,13 @@ end
---@param config table
---@param targetId integer
function Utils.DoStick(config, targetId)
if os.clock() - Utils.LastDoStick < 4 then
RGMercsLogger.log_debug("\ayIgnoring DoStick because we just stuck less than 4 seconds ago - let's give it some time.")
return
end

Utils.LastDoStick = os.clock()

if config.StickHow:len() > 0 then
Utils.DoCmd("/stick %s", config.StickHow)
else
Expand Down

0 comments on commit 908376f

Please sign in to comment.