Thread Tools Display Modes
06-17-08, 02:03 PM   #1
Dreadlorde
A Pyroguard Emberseer
 
Dreadlorde's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 2,302
Adding casting time

I'm trying to add casting time to DUF, and I was wondering if anyone can tell me if I added this to DUF_Variables.lua, would it work?
Code:
--Unit Cast Time
["$ux"] = { func = function*text, unit)
   local spell, _, _, _, _, endTime = UnitCastingInfo(unit);
      if (spell == nil) then 
      spellisChanneling = true;
      spell = UnitChannelInfo(unit);
      local finish = endTime/100 - GetTime()
   end;
   text = DUF_gsub(text, '$ux', value);
      return text;
   end,
events = {"UnitCastingInfo", "UnitChannelInfo"} },
__________________

Funtoo - Plan 9 - Windows 7
  Reply With Quote
06-17-08, 02:48 PM   #2
Maccaa
A Fallenroot Satyr
 
Maccaa's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 27
It won't work.

(Removed some of the code just to show the example of errors)
Code:
--Unit Cast Time
["$ux"] = { func = function(text, unit)
		local nSpell = UnitCastingInfo(unit)
		if nSpell == nil then
			nSpell = UnitChannelInfo(unit)
		end
		text = DUF_gsub(text, '$ux', nSpell)
	        return text
	end,
	events = {"UNIT_SPELLCAST_CHANNEL_START", "UNIT_SPELLCAST_START"} 
},
The above hasn't been tested (I can't get on WoW Atm - but it should work)

I tried to highlight where you had errors.

Last edited by Maccaa : 06-17-08 at 02:58 PM.
  Reply With Quote
06-17-08, 03:48 PM   #3
Dreadlorde
A Pyroguard Emberseer
 
Dreadlorde's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 2,302
Originally Posted by Maccaa View Post
It won't work.

(Removed some of the code just to show the example of errors)
Code:
--Unit Cast Time
["$ux"] = { func = function(text, unit)
		local nSpell = UnitCastingInfo(unit)
		if nSpell == nil then
			nSpell = UnitChannelInfo(unit)
		end
		text = DUF_gsub(text, '$ux', nSpell)
	        return text
	end,
	events = {"UNIT_SPELLCAST_CHANNEL_START", "UNIT_SPELLCAST_START"} 
},
The above hasn't been tested (I can't get on WoW Atm - but it should work)

I tried to highlight where you had errors.
Thanks for that (thought I fixed my typos ). But it didn't work. I'm going to see if I have to add it some where else in duf also.
__________________

Funtoo - Plan 9 - Windows 7
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Adding casting time

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off