Lines 106 - 150 need to be redone. Your if-then-else-end syntax is off (see
Programming in Lua 4.3.1). Too many ends. Essentially you're ending the if statements before they encounter the else(if)s.
Try this instead:
Code:
if event == "CHAT_MSG_ADDON" then
if prefix == "GAnnounce" then
if channel == "GUILD" then
UIErrorsFrame:AddMessage("[Guild Announcement]: " .. text, 0.3, 1, 0)
DEFAULT_CHAT_FRAME:AddMessage("[Guild Announcement] [" .. sender .. "]: " .. text, 0.3, 1, 0)
elseif channel == "PARTY" then
UIErrorsFrame:AddMessage("[Party Announcement]: " .. text, 0.4, 0.5, 0.9)
DEFAULT_CHAT_FRAME:AddMessage("[Party Announcement] [" .. sender .. "]: " .. text, 0.4, 0.5, 0.9)
elseif channel == "RAID" then
UIErrorsFrame:AddMessage("[Raid Announcement]: " .. text, 1.0, 0.5, 0.0)
DEFAULT_CHAT_FRAME:AddMessage("[Raid Announcement] [" .. sender .. "]: " .. text, 1.0, 0.5, 0.0)
elseif channel == "BATTLEGROUND" then
UIErrorsFrame:AddMessage("[Battleground Announcement]: " .. text, 1.0, 0.5, 0.0)
DEFAULT_CHAT_FRAME:AddMessage("[Battleground Announcement] [" .. sender .. "]: " .. text, 1.0, 0.5, 0.0)
elseif channel == "WHISPER" then
UIErrorsFrame:AddMessage("[" .. sender .. "]: " .. text, 1.0, 0.0, 1.0)
DEFAULT_CHAT_FRAME:AddMessage("[" .. sender .. "]: " .. text, 1.0, 0.0, 1.0)
end
elseif prefix == "GAnnounceRW" then
if channel == "GUILD" then
RaidNotice_AddMessage(RaidWarningFrame, text, gcolor)
DEFAULT_CHAT_FRAME:AddMessage("[Guild Announcement] [" .. sender .. "]: " .. text, 0.3, 1, 0)
elseif channel == "BATTLEGROUND" then
RaidNotice_AddMessage(RaidWarningFrame, text, bcolor)
DEFAULT_CHAT_FRAME:AddMessage("[Battleground Announcement] [" .. sender .. "]: " .. text, 1.0, 0.5, 0.0)
elseif channel == "WHISPER" then
RaidNotice_AddMessage(RaidWarningFrame, text, wcolor)
DEFAULT_CHAT_FRAME:AddMessage("[" .. sender .. "]: " .. text, 1.0, 0.0, 1.0)
end
end
end
Here's what you had, properly indented:
Code:
if event == "CHAT_MSG_ADDON" then
if prefix == "GAnnounce" then
if channel == "GUILD" then
UIErrorsFrame:AddMessage("[Guild Announcement]: " .. text, 0.3, 1, 0)
DEFAULT_CHAT_FRAME:AddMessage("[Guild Announcement] [" .. sender .. "]: " .. text, 0.3, 1, 0)
end
elseif channel == "PARTY" then
UIErrorsFrame:AddMessage("[Party Announcement]: " .. text, 0.4, 0.5, 0.9)
DEFAULT_CHAT_FRAME:AddMessage("[Party Announcement] [" .. sender .. "]: " .. text, 0.4, 0.5, 0.9)
end
elseif channel == "RAID" then
UIErrorsFrame:AddMessage("[Raid Announcement]: " .. text, 1.0, 0.5, 0.0)
DEFAULT_CHAT_FRAME:AddMessage("[Raid Announcement] [" .. sender .. "]: " .. text, 1.0, 0.5, 0.0)
end
--ERROR: '<eof>' expected near 'elseif'
elseif channel == "BATTLEGROUND" then --else(if) with no if!
See what's wrong?