local mq = require('mq')
local arg = {...}
-- different DIs
-- "Divine Interference","Divine Mediation", "Divine Intermediation",
-- "Divine Imposition", "Divine Indemnification", "Divine Interposition",
-- "Divine Invocation", "Divine Intercession","Divine Intervention", "Death Pact"
-- change this to what spell you want
local buff = 'Divine Interference'
local function spawncheck(name)
local spawnchk = string.format("radius 50 los %s", name)
return mq.TLO.SpawnCount(spawnchk)() or 0
end
local function target(name)
mq.cmd("/target " ..name)
mq.delay(10)
end
local function verifytarget(name)
return mq.TLO.Target.ID() or 0
end
local function checkbuff(buff)
return mq.TLO.Target.Buff(buff).ID() or 0
end
local function checktable(input)
for i = 0, #input do
print(input[i])
end
end
local function gemready(gem)
return mq.TLO.Me.SpellReady(gem)() or false
end
local function setup()
end
local function main()
while true do
if spawncheck(arg[1]) > 0 then
target(arg[1])
mq.delay(20)
if verifytarget(arg[1]) > 0 then
if checkbuff(buff) == 0 then
if gemready(buff) then
mq.cmd('/cast ' ..buff)
print('[KeepBuff] Casting ' ..buff)
end
end
end
end
mq.delay(100)
mq.delay(150)
end
end
-- set it the bind and such
setup()
-- run the main loop
main()