1. #1

    Step through friendly party members

    Is there a method to step through friendly party members and get the class and current spec?
    Looking for an example in LUA, but surprisingly, not finding anything...

    Thanks!

  2. #2
    Deleted
    You'd probably have to accord for somehow not getting data (inspect throttle), but the basic function looks like this:
    Code:
    local isScanning = false -- don't scan multiple times before the first one has finished. it breaks stuff, as we have to wait for the server to give us data every time.
    local nextMember
    local eventFrame = CreateFrame("Frame")
    local function scanNext()
        if not nextMember then return end
        nextMember = nextMember+1
        if nextMember > GetNumPartyMembers() then print("Scan finished!") nextMember = nil isScanning = false end
        eventFrame:RegisterEvent("INSPECT_READY")
        NotifyInspect("party"..nextMember)
    end
    local nums = {}
    eventFrame:SetScript("OnEvent",function(s)
        local treeName,primaryIcon
        table.wipe(nums)
        local primaryNum = GetPrimaryTalentTree(true)
        for tabNum=1, GetNumTalentTabs(true) do
            local _, name, _, icon, numPoints = GetTalentTabInfo(tabNum,true)
            if tabNum == primaryNum then
                treeName = name
                primaryIcon = icon
            end
            nums[tabNum] = numPoints
        end
        print((UnitName("party"..nextMember))..": |T"..(primaryIcon or "interface\\icons\\spell_shadow_sacrificialshield")..":20|t "..(treeName or "None").." ("..table.concat(nums,"/")..")")
        s:UnregisterEvent("INSPECT_READY")
        scanNext()
    end)
    SlashCmdList["SCANTALENTS"]=function()
        if isScanning then print("Already scanning! Wait for it to finish first!") return end
        nextMember = 0
        isScanning = true
        scanNext()
    end
    SLASH_SCANTALENTS1 = "/scantalents"
    Untested.
    Last edited by mmocba105e19de; 2011-09-16 at 04:32 PM.

  3. #3

Posting Permissions

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