LunaUnitFrames

LunaUnitFrames

268k Downloads

Combining overwrite check+ lunamo

lvangh opened this issue ยท 4 comments

commented

I'm at my wits' end with this one.
(vanilla 1.12)
So, there are macros that check if a renew/rejuv exists on a target and if there's one, it won't cast.

Something like
/run mo="mouseover" m=0 for i=1,40 do if UnitExists(mo) and (strfind(tostring(UnitBuff("target",i)),"Spell_Holy_Renew"))then m=1 end end if m==0 then TargetUnit(mo) CastSpellByName("Renew(Rank 9)") end

So this works for 3d world and non-Luna frames.

So I had this "brilliant" idea to combine Roid-Macros @mouseover check into a macro that would call my regular lunamo macro. (I can provide this code if wanted) but that still only calls the regular mouseover default Wow lua code.

I need a way to combine checking for an existing renew/rejuv WITH Luna's lunamo command.
Any suggestions?

Just making up my own nonsense code I am looking for something like this which is a weird hybrid of Roid-Macros code and Luna):

/lunamo [nobuff:Renew] Renew

commented

/run mo=GetMouseFocus().unit or "mouseover" m=0 for i=1,40 do if UnitExists(mo) and (strfind(tostring(UnitBuff("target",i)),"Spell_Holy_Renew"))then m=1 end end if m==0 then TargetUnit(mo) CastSpellByName("Renew(Rank 9)") end

commented

I am not your personal macro assistant. I showed you how to get the unit out of a mouseover in luna, the rest is up to you. Also casting in vanilla ALWAYS requires you to target the unit except for yourself and target changes are limited around 3 per frame for all addons combined.

commented

Sorry, I didn't mean it that way, I'm just stuck and am not a programmer so I don't know what to do :/
Maybe I can convert part of it to a SM function..hmmm

commented

Actually - Can we reopen this?

What happens is that you cast the spell on the Luna raid frame target, then that person becomes targeted, and other spells don't work on the other raid frame members. It's probably because of this function TargetUnit(mo) - maybe we can unselect the target after? (edit - unselecting prevents the target from being checked for the buff - scratch that. edit I tried adding a ClearTarget() at the end before the end but the overwrite check isn't working now. Maybe we can check if the target has the buff then cleartarget?

I can provide video evidence if needed. In short, the cast is /targeting the person who got the renew, and then mouseover stops working for other members.

How do I cast spell without targeting? Like
/run mo=GetMouseFocus().unit or "mouseover" m=0 for i=1,40 do if UnitExists(mo) and (strfind(tostring(UnitBuff("target",i)),"Spell_Holy_Renew"))then m=1 end end if m==0 then **Lunamo Renew(Rank 9)**; end

I just thought I could add a variable check and set it to 1 after the cast went off, then ClearTarget, but there's not enough room in the macro :/