1. #1

    macro into addon /run function

    hey! i know how to create simple addons with simple macros but, i do not know how to handle the /run function macros
    is it possible to get /run function macros into addons ? im just too lazy to press them everytime i log in



    the following are the macros i want to put into an addon

    Macro 1:
    /run function sp(f,i) tr="TOPRIGHT";f2=f.debuffFrames;s=f2[1]:GetWidth();f3=f2[i];f3:SetSize(s,s);f3:ClearAllPoints();if i>6 then f3:SetPoint("BOTTOMRIGHT",f2[i-3],tr,0,0) else f3:SetPoint(tr,f2[1],tr,-(s*(i-3)),0) end end

    Macro 2:
    /run function CBF(f,i) bf=CreateFrame("Button",f:GetName().."Debuff"..i,f,"CompactDebuffTemplate");bf.baseSize=22 ;bf:SetSize(f.buffFrames[1]:GetSize()) end;function mv(f) for i=4,12 do sp(f,i) end end

    Macro 3:
    /run function mv3(f) CompactUnitFrame_SetMaxDebuffs(f,12); if not f.debuffFrames[4] then for i=4,12 do CBF(f,i) end end mv(f) end;hooksecurefunc("CompactUnitFrame_UpdateAuras",function(f) n=f:GetName() if n and n:match("^Compact") then mv3(f) end end);

  2. #2
    Well copy the functions into a lua file.
    Then below the functions put

    C_Timer.After(5, function()

    - your functions you wanna call 5 sec after login / reload

    end)

  3. #3
    i guess its like this then:

    C_Timer.After(5, function()

    function sp(f,i) tr="TOPRIGHT";f2=f.debuffFrames;s=f2[1]:GetWidth();f3=f2[i];f3:SetSize(s,s);f3:ClearAllPoints();if i>6 then f3:SetPoint("BOTTOMRIGHT",f2[i-3],tr,0,0) else f3:SetPoint(tr,f2[1],tr,-(s*(i-3)),0) end end

    end)

    right?

    thank you very much btw!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •