Mouseover healing

Re: Mouseover healing

by Kalahn » Wed May 27, 2015 3:12 pm

Tried to download a newer version, and I got this error message:
"Interface/AddOns/LunaUnitframes/LunaUnitFrames.lua:217: attempt to index global ` LunaOptionsFrame ' (a nil value)".

So now I can't open the options menu either. Any ideas?
Kalahn
Tester
 

Re: Mouseover healing

by Kalahn » Wed May 27, 2015 3:56 pm

I deleted the old WDB files, deleted and downloaded the latest version again and got it to work, had to redo all the settings but no worries! Thanks for an awesome addon. :)
Kalahn
Tester
 

Re: Mouseover healing

by Euronymous » Thu Jun 04, 2015 9:19 pm

After having lots of trouble getting mouseover to work, I found what works best for me to be a small lua script, loaded as an addon.

This will cast on your target, if you have one, otherwise on your mouseover target.

Code: Select all
function SmartCastFriend(spell)
local haveTarget = UnitExists("target")
local target = "player"

local f = GetMouseFocus()

if (UnitExists("target") and UnitReaction("target", "player") >= 4) then
   target = "target"
elseif (f.unit and UnitReaction(f.unit, "player") >= 4) then
   target = f.unit
elseif (UnitExists("mouseover") and UnitReaction("mouseover", "player") >= 4) then
   target = "mouseover"
end

if (UnitIsUnit(target, "target")) then
   CastSpellByName(spell)
else
        TargetUnit(target)
   CastSpellByName(spell)
if (haveTarget) then
   TargetLastTarget()   
else
   ClearTarget()
end
end
end
User avatar
Euronymous
Grunt
Grunt
 

Re: Mouseover healing

by isihia » Tue Jun 09, 2015 10:28 am

do i have to load any other addon to get this lua script to work ?
isihia
Private
Private
 

Re: Mouseover healing

by Euronymous » Wed Jun 10, 2015 7:59 pm

isihia wrote:do i have to load any other addon to get this lua script to work ?


The quick way to get it to work would be: make a folder in the addons directory, say "foo" and in there make a .lua file, say "mouseover.lua" and a .toc file with the same name as the folder (foo.toc in this case). The last file must contain a reference to the .lua file so it should just containt "mouseover.lua" in this case.

Now load the addon ingame and invoke the script through a macro, for example:

Code: Select all
/script if nil then CastSpellByName("Heal(Rank 1)") end
/run SmartCastFriend("Heal(Rank 1)")
User avatar
Euronymous
Grunt
Grunt
 

Previous

Return to Priest