Quantcast Guild Note Group Inviter - WoWInterface
Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-25-18, 08:22 AM   #1
A Defias Bandit
Join Date: Jan 2018
Posts: 2
Guild Note Group Inviter

I know nothing about lua and was wondering if someone can help me fix some issue I'm having.

So the addon is supposed to invite people that match the phrase in the command to their guild note
E.I... '/rinv weekday' will invite anyone with weekday in their guild note.

So first off I took this addon

and edited the RosterInvite.lua to the following.
-- instantiate a new ace addon
local AddOn = LibStub("AceAddon-3.0"):NewAddon("RosterInvite", "AceConsole-3.0")

-- declare slash commands
SLASH_ROSTERINVITE2 = '/rosterinv'
SLASH_ROSTERINVITE3 = '/rosterinvite'

-- declare handler for slash commands
local function Handler(msg, editbox)
    -- check for arguments
    local inviteAll = false
    --local rankName = msg
    local noteNames = {}
    if msg == "" then
        -- no arguments mean we should invite everyone
        inviteAll = true
        AddOn:Print("Inviting all guild members")
        -- an argument means we should invite all players with that rank
        inviteAll = false
        local notes = string.lower(msg)
        AddOn:Print("Inviting guild members with notes: " .. notes)
        for note in string.gmatch(notes, "[^ ]+") do
            table.insert(noteNames, note)

    -- invite players
    numTotalMembers, numOnlineMaxLevelMembers, numOnlineMembers = GetNumGuildMembers()
    for i=1,numOnlineMembers,1 do
        -- get player info
        name, rank, rankIndex, level, class, zone, note, 
            officernote, online, status, classFileName, 
            achievementPoints, achievementRank, isMobile, 
            isSoREligible, standingID = GetGuildRosterInfo(i);
        -- check player info
        if inviteAll then
            -- invite the player
            AddOn:Print("Invited: " .. name .. " (" .. string.lower(note) .. ")")
            for _, noteName in pairs(noteNames) do
                if string.lower(note) == string.lower(noteName) then
                    -- invite the player
                    AddOn:Print("Invited: " .. name .. " (" .. noteName .. ")")

-- register slash command handler
SlashCmdList["ROSTERINVITE"] = Handler;

-- declare ace oninit function
function AddOn:OnInitialize()
Now this works, however, it will not invite people if they have more stuff in their note. So normally I would have someone note be "Weekday Raider 950 Feral" or "Weekend Raider 955 Prot pally". I would like to keep that but with the quick edit I made to the addon above, it doesn't work if I do keep that extra stuff. another issue, that is minor, is it being case sensitive, the addon will not work with capitals.

Once again any help will be great!

~ Cheers Bamboozle
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Guild Note Group Inviter

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off