Close
Showing results 1 to 1 of 1
  1. #1

    Default FTL System using Action Bar Page

    Hi.
    I just wanted to share my idea of an FTL system.
    My issue with /click EMAAssistMaster is that changing leader don't work in combat.
    You could use /focus on your main (except on classic but soon on TBC), but if you do that, you lose the ability to use focus for anything else.

    I made a video, but my english is terrible, really sorry about that, please do a better video if you like the idea :



    So, with action bar page, you don't have this kind of limitations, if you set your page 2 to your first follower and set all action prefix with /assist Follower2 /cast spell, you just have to change the action bar page (with the keybind in the Wow UI) and that's just work.

    The issue is that will take you a lot of time and you have a limited number of macro availiable.
    That's why i use this addon : https://www.wowinterface.com/downloa...36-Neuron.html

    And i made a little modification (it's really dirty, i have 0 skill as a lua programmer) to make it work with EMA and simplify the macro writing :
    #EMAPAGE copy the base macro to all pages
    #AEMA get replaced by /assist <YourEmaCharacter>
    #FEMA get replaced by /follow <YourEmaCharacter>

    ACTIONBUTTON.lua :
    Code:
    function ACTIONBUTTON:SetType()
    
    
        self:ClearButton(true)
    
    
        SecureHandler_OnLoad(self)
    
    
        if self.class ~= "flyout" then
            self:SetupEvents()
        end
    
    
        self:ParseAndSanitizeMacro()
    
    
        self:SetAttribute("type", "macro")
        self:SetAttribute("*macrotext*", self.macro)
    
    
        self:SetScript("PostClick", function(self, mousebutton) self:PostClick(mousebutton) end)
        self:SetScript("OnReceiveDrag", function(self, preclick) self:OnReceiveDrag(preclick) end)
        self:SetScript("OnDragStart", function(self, mousebutton) self:OnDragStart(mousebutton) end)
    
    
        --this is to allow for the correct releasing of the button when dragging icons off of the bar
        --we need to hook to the WorldFrame OnReceiveDrag and OnMouseDown so that we can "let go" of the spell when we drag it off the bar
        if not Neuron:IsHooked(WorldFrame, "OnReceiveDrag") then
            Neuron:HookScript(WorldFrame, "OnReceiveDrag", function() ACTIONBUTTON:WorldFrame_OnReceiveDrag() end)
        end
        if not Neuron:IsHooked(WorldFrame, "OnMouseDown") then
            Neuron:HookScript(WorldFrame, "OnMouseDown", function() ACTIONBUTTON:WorldFrame_OnReceiveDrag() end)
        end
    
    
        self:SetScript("OnAttributeChanged", function(self, name, value) self:OnAttributeChanged(name, value) end)
        self:SetScript("OnEnter", function(self, ...) self:OnEnter(...) end)
        self:SetScript("OnLeave", function(self, ...) self:OnLeave(...) end)
    
    
        self:SetAttribute("overrideID_Offset", 156)
        self:SetAttribute("vehicleID_Offset", 132)
    
    
    
    
                                
        --This is so that hotkeypri works properly with priority/locked buttons
        self:WrapScript(self, "OnShow", [[
                for i=1,select('#',(":"):split(self:GetAttribute("hotkeys"))) do
                    self:SetBindingClick(self:GetAttribute("hotkeypri"), select(i,(":"):split(self:GetAttribute("hotkeys"))), self:GetName())
                end
                ]])
    
    
        self:WrapScript(self, "OnHide", [[
                if not self:GetParent():GetAttribute("concealed") then
                    for key in gmatch(self:GetAttribute("hotkeys"), "[^:]+") do
                        self:ClearBinding(key)
                    end
                end
                ]])
                
    
    
        emanumberchar = 0
        for characterOrder, characterName in EMAApi.TeamListOrdered() do
            local removestring = "-"..GetNormalizedRealmName()
            emanumberchar = emanumberchar + 1
            characterName = string.gsub(characterName,removestring,"")
            self:SetAttribute("ema-paged"..characterOrder, characterName)
            --print("SET ema-paged"..characterOrder)
        end
        self:SetAttribute("ema-homestate", self:GetAttribute("ema-paged1"))
        self:SetAttribute("emanumberchar", emanumberchar)
        myname, myrealm = UnitName("player")
        self:SetAttribute("emamyname",myname)
        
    
    
        
    
    
        self:SetAttribute("_childupdate",
                [[
    
    
                    if message then
    
    
                        local msg = (":"):split(message)
    
    
                        if msg:find("vehicle") then
    
    
                            if not self:GetAttribute(msg.."-actionID") then
                                self:SetAttribute("type", "action")
                                self:SetAttribute("*action*", self:GetAttribute("barPos")+self:GetAttribute("vehicleID_Offset"))
                            end
    
    
                            self:SetAttribute("HasActionID", true)
                            self:Show()
    
    
                        elseif msg:find("possess") then
    
    
                            if not self:GetAttribute(msg.."-actionID") then
                                self:SetAttribute("type", "action")
                                self:SetAttribute("*action*", self:GetAttribute("barPos")+self:GetAttribute("vehicleID_Offset"))
                            end
    
    
                            self:SetAttribute("HasActionID", true)
                            self:Show()
    
    
                        elseif msg:find("override") then
    
    
                            if not self:GetAttribute(msg.."-actionID") then
                                self:SetAttribute("type", "action")
                                self:SetAttribute("*action*", self:GetAttribute("barPos")+self:GetAttribute("overrideID_Offset"))
                                self:SetAttribute("HasActionID", true)
                            end
    
    
                            self:SetAttribute("HasActionID", true)
                            self:Show()
    
    
                        else
    
    
                            if not self:GetAttribute(msg.."-actionID") then
    
    
                                self:SetAttribute("type", "macro")
                                
                                
                                
                                --debutreplace
                                local macrotxt = self:GetAttribute(msg.."-macro_Text")
                                
                                if msg=="paged2" or msg=="paged3" or msg=="paged4" or msg=="paged5" then
                                    local pagenums = string.gsub(msg,"paged","")
                                    local b = tonumber(pagenums) ~= nil
                                    if b then
                                        local pagenum = tonumber(pagenums)
                                        local numchar = self:GetAttribute("emanumberchar")
                                        local homepagemacro = self:GetAttribute("homestate-macro_Text")
                                        if homepagemacro and homepagemacro:find("#EMAPAGE") then
                                            if pagenum <= numchar then
                                                macrotxt = homepagemacro
                                            end                                        
                                        end
                                    end
                                end
                                local namefromema = self:GetAttribute("ema-"..msg)
                                if namefromema and #namefromema > 0 then
                                    if macrotxt and #macrotxt > 0 then
                                        macrotxt = string.gsub(macrotxt,"#EMAPAGE", "")
                                        if namefromema == self:GetAttribute("emamyname") then
                                            macrotxt = string.gsub(macrotxt,"#FEMA", "")
                                            macrotxt = string.gsub(macrotxt,"#AEMA", "")                                
                                        else
                                            macrotxt = string.gsub(macrotxt,"#FEMA", "/follow "..namefromema)
                                            macrotxt = string.gsub(macrotxt,"#AEMA", "/assist "..namefromema)                                
                                        end
                                        macrotxt = string.gsub(macrotxt,"#EMA", namefromema)
                                        
                                    end
                                end
                                self:SetAttribute("*macrotext*", macrotxt)
                                --finreplace
                                
                                
                                --self:SetAttribute("*macrotext*", self:GetAttribute(msg.."-macro_Text"))
                                
    
    
    
    
                                --if there is a macro present, or if showGrid is enabled, show the button. If not, hide it. This works in combat.
                                if (self:GetAttribute("*macrotext*") and #self:GetAttribute("*macrotext*") > 0) or self:GetAttribute("showGrid") then
                                    self:Show()
                                else
                                    self:Hide()
                                end
    
    
                                self:SetAttribute("HasActionID", false)
                            else
                                self:SetAttribute("HasActionID", true)
                            end
                        end
    
    
                        self:SetAttribute("activestate", msg)
    
    
                    end
    
    
                ]])
    
    
        --this is our rangecheck timer for each button. Every 0.5 seconds it queries if the button is usable
        --this doubles our CPU usage, but it really helps usability quite a bit
        --this is a direct replacement to the old "onUpdate" code that did this job
    
    
        if self:TimeLeft(self.rangeTimer) == 0 then
            self.rangeTimer = self:ScheduleRepeatingTimer("UpdateUsable", 0.5)
        end
    
    
        self:UpdateAll()
        self:UpdateFlyout(true)
        self:SetSkinned()
    end
    Last edited by Baltyre : 04-29-2021 at 11:44 AM

Posting Rules

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