Hi, i recently downloaded the addon Relic. It's a tiny addon which says "Welcome" to anyone who joined the guild and also says Ding *X lvl* in /g and /s.
Problem i have is it removes other frames in the UI when it says Ding, namely it removes/declines i don't know the join dungeon, which really screws me over as a leveling dps. Nevermind, i don't like the Ding thing either way and i'm wondering if anyone who knows lua could help me point out which part of the code i should remove to make the Ding go away completely.
Another thing i'm wondering is how i can change the welcome text from "Welcome" to "Welcome, NAME"?
Here's the whole addon, xml wouldn't copy well so i provided a screenshot. http://puu.sh/XiAR
Code:
-- Author : cpsim
-- Create Date : 3/28/2011 5:50:00 PM
ml = "";
function RAGuild_OnEvent(event, ...)
--DEFAULT_CHAT_FRAME:AddMessage(event.." in onevent");
--DEFAULT_CHAT_FRAME:AddMessage(...);
if event == "CHAT_MSG_SYSTEM"then
local msg = ...;
--DEFAULT_CHAT_FRAME:AddMessage("args "..arg1.." "..arg2);
if (msg and msg ~= nil) then
if ((string.find(msg, "has joined the guild") ~= nil)) then
starts, ends = string.find(msg," ")
args1 = string.sub(msg, 0, starts-1)
if (args1 ~= UnitName("player"))then
SendChatMessage("Welcome", "GUILD", ml, arg2);
end
end
end
end
if event == "ADDON_LOADED" then
local arg1 = ...;
if arg1 == "RAGuild" then
if RAGInstalled == nil then
RAGInstalled = date()
end
DEFAULT_CHAT_FRAME:AddMessage("|c00ffff00"..GetAddOnMetadata("RAGuild", "Title") .. " |r|c0000ffffV" .. GetAddOnMetadata("RAGuild", "Version").."|r\nWas Installed on "..RAGInstalled);
end
end
if event == "PLAYER_LEVEL_UP" then
local arg1 = ...;
if (IsInGuild()) then
SendChatMessage("Ding "..arg1.." ", "GUILD", ml, "");
end
if (GetNumPartyMembers() > 0) then --need to check for number of party members
SendChatMessage("Ding "..arg1.." ", "PARTY", ml, "");
else
SendChatMessage("Ding "..arg1.." ", "SAY", ml, "");
end
end
if event == "PLAYER_LEAVING_WORLD" then
RAGuild:UnregisterEvent("PLAYER_LEVEL_UP");
RAGuild:UnregisterEvent("CHAT_MSG_SYSTEM");
RAGuild:UnregisterEvent("ADDON_LOADED");
end
end
function RAGuild_OnLoad()
--DEFAULT_CHAT_FRAME:AddMessage("in onload");
local ourRace = UnitRace("player");
hellofired=false
if (ourRace == "Human" or ourRace == "Dwarf" or ourRace == "Gnome" or ourRace == "Night Elf" or ourRace == "Draenei" or ourRace == "Worgen") then
ml = "Common";
else
ml = "Orcish";
end
RAGuild:RegisterEvent("CHAT_MSG_SYSTEM");
RAGuild:RegisterEvent("ADDON_LOADED");
RAGuild:RegisterEvent("PLAYER_LEVEL_UP");
end