Jump to content


Photo

Gearswap Party Buff


    3 replies to this topic

    #1 MomalPSA

    MomalPSA

      Member

    • Members
    • PipPip
    • 10 posts

      Posted 25 September 2015 - 11:35 AM

      Hello,

      I wanted to know if there is a way to get the player.target buffactive[] for people in party ?

      the same way we get our own ones.

       

      Thank you. 



      #2 sdahlka

      sdahlka

        Advanced Member

      • Members
      • PipPipPip
      • 324 posts

        Posted 25 September 2015 - 07:18 PM

        partybuffs[index].buffs[n]

         

        index = the index id of the party member

        n = is the buff slot number

         

        here is some untested code

         

        function check_for_party_buff(buff_name)
            if partybuffs[player.target_index] then
                for _,v in pairs(partybuffs[player.target_index].buff) do
                    buff = gearswap.res.buffs[v].name
                    if buff == buff_name then
                        return true
                    end
                end
            end
        end
        
        buff_name = the name of the buff you want to see if the party member has
        check like this
        if check_for_party_buff(buff_name) then
            --do somthing
        end
         


        #3 MomalPSA

        MomalPSA

          Member

        • Members
        • PipPip
        • 10 posts

          Posted 29 September 2015 - 09:33 AM

          I just tried, it doesn't work.

          The lua doesn't seem to find what's partybuffs table.

           

          I get this error :

           

          11:06:43 > GearSwap: Lua runtime error: ...gram Files (x86)/Windower4//addons/gearswap/flow.lua:295: 
          11:06:43 > GearSwap has detected an error in the user function self_command:
          11:06:43 > ...(x86)\Windower4\/addons/gearswap/data/WHM.lua:375: attempt to index global 'partybuffs' (a nil value)
           
          Am I missing something ?


          #4 trv

          trv

            Advanced Member

          • Members
          • PipPipPip
          • 34 posts

            Posted 29 September 2015 - 10:08 PM

            local name = windower.ffxi.get_mob_by_index(data:unpack('H',i*48+5+4)).name
            
            partybuffs[name] = {
                index = data:unpack('H',i*48+5+4),
                buffs = {}
            }
            

            The table is indexed by name.






            1 user(s) are reading this topic

            0 members, 1 guests, 0 anonymous users