Psychi
Authorized
- Joined
- May 24, 2010
Hi, I really enjoy coding in LUA and since I'm beginner (started two days ago) I'm writing some easy short scripts for usefull in-game stuff.
My first work is this piece of code which allows you track proc of spells you choose. (Dagtrinactt request)
You can put this to LUA code of any addon or use SuperMacro (recommended).
You just call function in example below in macro and add name of spells as arguments in same format.
(Calling script twice will end tracking)
My first work is this piece of code which allows you track proc of spells you choose. (Dagtrinactt request)
You can put this to LUA code of any addon or use SuperMacro (recommended).
Code:
if not procCheck then
procCheck = CreateFrame("Frame")
end
start = 0
procs = {}
function TrackProc(...)
if start == 0 then
spells = arg
for k,v in spells do
if k ~= "n" then
procs[k] = 0
end
end
start = 1
timeStart = GetTime()
procCheck:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE")
DEFAULT_CHAT_FRAME:AddMessage("Proc log STARTED")
else
procCheck:UnregisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE")
start = 0
timeEnd = GetTime()
timeShit = timeEnd - timeStart
timeShit = math.ceil(timeShit-0.5)
DEFAULT_CHAT_FRAME:AddMessage("Proc log ENDED after "..timeShit.." seconds.")
for k,v in spells do
if k ~= "n" then
DEFAULT_CHAT_FRAME:AddMessage(v.." proc'd: "..procs[k].." times.")
end
end end
end
procCheck:SetScript("OnEvent", function ()
if arg1 ~= nil then
for k,v in spells do
if k ~= "n" then
if string.find(arg1, v) then
procs[k] = procs[k] + 1
end
end
end
end
end)
You just call function in example below in macro and add name of spells as arguments in same format.
Code:
/script TrackProc("Hand of Justice","Seal of Command","Crusader's Wrath","Fatal Wound");
(Calling script twice will end tracking)
___________________________________________
If you are looking for something, you can post your request here and I can try to create something just for you!
If you are looking for something, you can post your request here and I can try to create something just for you!
Last edited: