Thread Tools Display Modes
04-22-06, 11:37 AM   #1
setar
A Murloc Raider
Join Date: Apr 2006
Posts: 4
WatchDog custom functions

'lo everyone,


I've been using a macro for a priest char -- it checks whether the current target already has a Renew HoT ticking. Now I'm struggling to integrate this with WatchDog's click-casting functionality. However, It checks the target instead of the char the mouse is currently hovering over.

Code:
function WD_SafeRenew(unit)

  local b = 1
  for j=0,15 do 
    a = UnitBuff(unit, j)
    if (a and string.find(a, "Renew")) then 
      b = nil
      break
    end
  end

  if (b) then 
    CastSpellByName("Renew")
  end
Could someone point me into the right direction? Thanks in advance!

-- Oliver
  Reply With Quote
04-22-06, 12:19 PM   #2
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
Code:
function WD_SafeRenew(unit)
	for j=1,32 do
		local a = UnitBuff(unit,j)
		if a and strfind(a, "Renew") then
			return 
		end
	end
	
	ClearTarget()
	CastSpellByName("Renew")
	SpellTargetUnit(unit)
	TargetLastTarget()
end
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » WatchDog custom functions


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