Creating an Addon from LUA snippet.

May 26, 2009 at 10:14 PM

Ok so i am creating an addon for my private server (Wow-caelum.com, 2.4.3, 3.0.x, 3.1.x servers) for my Gamemasters. I got the idea from this snippet i had made earlier, an auto-party inviter.

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)

I thought i would change it to this so whenever a player whispers "!summon" they get summoned by using the command .summon.

local f = CreateFrame("frame")
f:RegisterEvent("CHAT_MSG_WHISPER")
f:SetScript("OnEvent", function(self,event,arg1,arg2)
    if arg1:lower():match("!summon") then
        PlayerSay ".summon" +Playername(arg2)
    end
end)

 

But im 14 years old and i fucked it up so i want help. :D

Coordinator
May 26, 2009 at 10:23 PM

Hello,

We're only a few people working on this project so we can't provide technical support for addons as we don't have the resources.

If you have a general question on building an addon, I'd suggest trying the UI and Macros forum -
http://forums.worldofwarcraft.com/board.html?forumId=11114&sid=1

or check out our learning resources (copy/pasted from home page)

What are some recommended resources for learning how to build Warcraft AddOns?

 

That being said, setting up a private server is a violation of Warcraft's terms of use so I don't think anyone on the Warcraft forums will be able to (or perhaps willing) to help you.

Thanks,
-Dan