i am at work so cant access my wow to test but I have done some ground work.
Am I on the right track here??
Code:
-- Name : QuickMouseOverCasting
-- Author : chris.winfieldblum
-- Notes : Designed to remove the need for multiple macros when you
-- you choose to use Mouse Over Casting
-- Create Date : 3/31/2009 10:05:17 AM
local qmoc_version = "0.1";
function QuickMouseOverCasting:OnInitialize()
-- Get my own player name
local playerName = UnitName("player");
local playerClass = UnitClass("player")
-- Check if playerClass is supported
if(QMOC_Data[playerClass]) then
-- Check if our Spell is enabled
if (QMOC_Data[playerClass][SpellName][enabled] = 1) then
-- Get our Targets with following priority
-- mouseover, target, focus, self
local MouseoverName = UnitName("mouseover"); -- Do we have a mousover target
local MouseoverIsFriend = UnitIsFriend(playerName, MouseoverName) -- is it a friend
local TargetName = UnitName("target"); -- do we have a target selected
local TargetIsFriend = UnitIsFriend(playerName, TargetName) -- is it a friend
local FocusName = UnitName("focus"); -- do we have a focus set
local FocusIsFriend = UnitIsFriend(playerName, FocusName) -- is it a friend
-- Check out Targets
if (MouseoverName and MouseoverIsFriend = 1) then
-- Cast Our Spell on Mouseover
CastSpellByName("Lifebloom" [, MouseoverName])
else if(TargetName and TargetIsFriend = 1)
-- Cast Our Spell on Target
CastSpellByName("Lifebloom" [, TargetName])
else if(FocusName and FocusIsFriend = 1)
-- Cast Our Spell on Focus
CastSpellByName("Lifebloom" [, FocusName])
else
-- Cast Our Spell on Ourself
CastSpellByName("Lifebloom" [, playerName])
end
end
end
end