Auto invite addon

This snippet will auto-invite anyone who whispers the player with "I love you".

Snippet

local f = CreateFrame("frame")
f:RegisterEvent("CHAT_MSG_WHISPER")
f:SetScript("OnEvent", function(self,event,arg1,arg2)
    if (not UnitExists("party1") or IsPartyLeader("player")) and arg1:lower():match("i love you") then
        InviteUnit(arg2)
    end
end)
Posted by Mikma at Mon, 27 Apr 2009 10:45:37 +0000