Auto welcome addon for guildmembers
Posted: Thu May 12, 2011 3:43 pm
The addon I'm trying to make is for welcoming guildmembers when they come online. The follwing is what I've got so far, it's not working. Therefor I would like some help, since this is my first addon. I've modified addons before, but my knowledge of addon is limited (for now).
WelcomeGuildmember.toc
WelcomeGuildmember.xml
WelcomeGuildmember.lua
WelcomeGuildmember.toc
Code: Select all
## Title: Welcome Guildmember
## Version: 0.1
## Notes: Welcomes guildmembers who come online
## Author: Questionmark
WelcomeGuildmember.xml
Code: Select all
<Ui xmlns="http://www.extreme-x.net/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.extreme-x.net/UI.xsd">
<Script file="WelcomeGuildmember.lua"/>
<Frame hidden="true">
<Scripts>
<OnLoad>
WelcomeGuildmember_OnLoad(this);
</OnLoad>
<OnEvent>
WelcomeGuildmember_OnEvent(this, event);
</OnEvent>
</Scripts>
</Frame>
</Ui>
Code: Select all
function WelcomeGuildmember_OnLoad(this)
self:RegisterEvent("CHAT_MSG_GUILD");
DEFAULT_CHAT_FRAME:AddMessage("Welcome Guildmember v0.1 loaded.",102,153,204);
end
function WelcomeGuildmember_OnEvent(this, event)
if event == "CHAT_MSG_GUILD" then
local online = string.lower(arg1);
local name = string.lower(arg4);
if (string.find(online, " is online") ~= nil) then
SendChatMessage("hi " .. name, "GUILD");
end
end
end