1. #1
    Titan Synthaxx's Avatar
    Join Date
    Feb 2008
    Location
    Rotherham, England/UK
    Posts
    12,996

    Guild invite addon help

    Update - From post #3;
    Following on from last nights request, I've now built a list-based addon similar to what I originally wanted; http://www.wowinterface.com/download...iteAssist.html

    It's lacking some important checks, but I figure that for a first addon, it's not too bad.
    Hey all,
    I've recently moved most of my main characters to another realm and set up my own guild. It's intended to be a casual and social guild where the members lead their own groups and such, but I'd still like to find a less... manual, way of inviting guild members. I had considered SGI for a moment before realizing just how bad that idea was. I absolutely despise automated guild invites from random strangers on my own characters, and so I absolutely refuse to impose that on others. Even if people can block invites from the UI, hitting invites on those that don't want to be invited but haven't yet changed their settings just won't do. Additionally, this method doesn't block the spam of whispers people get sent from SGI.

    As such, I'd like an addon that works the other way - someone whispers me a specific phrase and they get sent a guild invite automatically. I did find one such example from the ~4.2 era, but this functionality has been blocked by the API since 4.3, or rather, it can't be automated. To this end, I'd like to end up on a middle ground - someone whispers me the phrase, a button appears in the middle of the screen, and I click it to invite the person that whispered me. The button needs to be noticable, but obviously this is just an issue of placement and scaling.

    Now, If I run this from within WoW;
    Code:
    /run GuildInvite("PlayerName");
    ... it'll invite the player called "PlayerName" to the guild. This works since it was done manually by the user. Is it possible for me to modify the addon linked above to place such functionality into a UI button, and to invite the player that whispered the phrase? Alternatively, having a list of clickable player names for those that have whispered would be even better as then there's no risk of missing people if I get multiple whispers at the same time.

    I'm not bothered about having to click the button, but having to manually deal with each individual guild invite would be a hassle. I want something that's more approachable and passive in it's recruitment method (compared to SGI), but which provides a much simpler method than typing each players name out on my end (considering I'm not the most fluent when it comes to typing out characters with accents and such). I do understand someone can request a guild invite through the UI, but I figure something that's more prominent and defined would be a useful addition.

    I've got no LUA experience and as such don't even know where to begin with writing or modifying such an addon. All the pieces are there, I just need some help piecing it all together.

    Clarification/TLDR: Someone whispers me a certain phrase > A button appears/they get added to a list in the UI > I click their name in the list to invite them to the guild | This link is relevant: http://us.battle.net/wow/en/forum/topic/6147177192
    Last edited by Synthaxx; 2013-06-25 at 04:39 AM.
    Coder, Gamer - Thoughtcloud | NEW SITE: IOCube| Node.js Monkey | #Error418MasterRace
    Knows: Node.js, JS, JQuery, HTML, CSS, Object Pascal, PHP, WQL/SQL, Ruby

    PC: 750D / 16GB / 256GB + 750GB / GTX780 / 4670K / Z87X-UD4H | Laptop: 8GB / 120GB + 480GB / GTX765M / 4700MQ

  2. #2
    Give this a shot. It doesn't keep a list of whisperers, it will only invite the last person to whisper you a keyphrase:

    Code:
    local keyphraseHash = {
    	["guild invite"] = 1,
    };
    local playerName;
    local b = CreateFrame("button", nil, UIParent);
    b:SetSize(150, 150);
    b:SetPoint("center");
    b:Hide();
    b.texture = b:CreateTexture();
    b.texture:SetTexture("interface\\icons\\trade_engineering");
    b.texture:SetAllPoints();
    
    
    local function onEvent(self, event, ...)
    	if ( event == "CHAT_MSG_WHISPER" ) then
    		local message, senderName = select(1, ...);
    		if ( keyphraseHash[strlower(strtrim(message))] ~= nil ) then
    			playerName = senderName;
    			b:Show();
    		end
    	end
    end
    
    
    local function onClick(self, button, isDown)
    	if ( playerName ~= nil ) then
    		b:Hide();
    		GuildInvite(playerName);
    		playerName = nil;
    	end
    end
    
    
    b:RegisterEvent("CHAT_MSG_WHISPER");
    b:SetScript("OnEvent", onEvent);
    b:SetScript("OnClick", onClick);

  3. #3
    Titan Synthaxx's Avatar
    Join Date
    Feb 2008
    Location
    Rotherham, England/UK
    Posts
    12,996
    Quote Originally Posted by Woogs View Post
    Give this a shot. It doesn't keep a list of whisperers, it will only invite the last person to whisper you a keyphrase
    Works perfectly! I think I can figure out the rest from there. Thanks

    ---------- Post added 2013-06-25 at 05:38 AM ----------

    Following on from last nights request, I've now built a list-based addon similar to what I originally wanted; http://www.wowinterface.com/download...iteAssist.html

    It's lacking some important checks, but I figure that for a first addon, it's not too bad.
    Coder, Gamer - Thoughtcloud | NEW SITE: IOCube| Node.js Monkey | #Error418MasterRace
    Knows: Node.js, JS, JQuery, HTML, CSS, Object Pascal, PHP, WQL/SQL, Ruby

    PC: 750D / 16GB / 256GB + 750GB / GTX780 / 4670K / Z87X-UD4H | Laptop: 8GB / 120GB + 480GB / GTX765M / 4700MQ

Posting Permissions

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