Jump to content

Simple Script to time Delay


  • Please log in to reply
1 reply to this topic

#1 Gravestoner

Gravestoner
  • Members
  • Posts: 6

Posted 17 July 2013 - 03:20 AM

I have been attempting to figure out exactly the time delay between damage dealt by Global Thermal Sapper Charge and the damage received.

I'm very new to Lua so this is what I came up with.

local g = CreateFrame("Frame")
	 g:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

	 g:SetScript("OnEvent",function(_,_,_,event,...)
		  if event == "SPELL_DAMAGE" then
			   local destGUID = select(8, ...)
					if destGUID == "target" then
						 local spellId = select(11, ...)
							  if spellId == "Global Thermal Sapper Charge" then
								   iTime = GetTime()
							  end
					elseif destGUID == "player" then
						 local spellName = select(12, ...)
							  if spellName == "Global Thermal Sapper Charge" then
								   eTime = GetTime()
								   Timer = eTime-iTime
								   print(Timer)
							  end
					end

		  end
end)

Any help is much appreciated thank you.

#2 Gravestoner

Gravestoner
  • Members
  • Posts: 6

Posted 17 July 2013 - 03:45 AM

local g = CreateFrame("Frame")
g:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

g:SetScript("OnEvent",function(_,event,_,eventType,_,_,_,destGUID,_,_,spellId,...)
if event == "COMBAT_LOG_EVENT_UNFILTERED" then
if eventType == "SPELL_DAMAGE" then
if destGUID == "target" then
if spellId == 56514 then
	 iTime = GetTime()
	 print(GetTime())
end
elseif destGUID == "player" then
if spellId == 56514 then
	 eTime = GetTime()
	 Timer = eTime-iTime
	 print(Timer)
end
end
end
end
end)

or maybe this is closer idk.

EDIT* I fixed it. thanks soo much guys, you da best.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<