WoWInterface SVN LastWords

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 9 to Rev 10
    Reverse comparison

Rev 9 → Rev 10

trunk/LastWords.lua
1,5 → 1,5
local LW_Ver = 2.0
local LW_Compat = 2.0
local LW_Ver = 2.1
local LW_Compat = 2.1
 
function Initialise_LastWord_Options()
lastwords_options = {}
8,7 → 8,8
["debug"] = false,
["collect"] = true,
["critters"] = {},
["version"] = LW_Ver
["version"] = LW_Ver,
["startdate"] = date("%H:%M:%S, %a %b %d %Y"),
}
end
 
84,34 → 85,52
-- DEFAULT_CHAT_FRAME:AddMessage("|cFFFF8800".."You need to target the critter you wish to add!|r");
-- end
elseif tbl[1] == "report" then
local output
output = ""
for index,value in pairs(lastwords_options["critters"]) do
if value ~= 0 then
if value ==1 then
output = output..value.." "..index..", ";
else
local CName
if strsub(index, -1) == "y" then
CName = strsub(index,1, -1).."ies"
elseif strsub(index, -2) == "ch" then
CName = index.."es"
if tbl[2] == "r" or tbl[2] == "raid" then
if GetNumRaidMembers > 0 then
LW_Report("RAID")
else
DEFAULT_CHAT_FRAME:AddMessage("|cFFFF8800".."You are not in a raid!|r")
end
elseif tbl[2] == "g" or tbl[2] == "guild" then
LW_Report("GUILD")
elseif tbl[2] == "p" or tbl[2] == "party" then
if GetNumPartyMembers() > 0 then
LW_Report("PARTY")
else
DEFAULT_CHAT_FRAME:AddMessage("|cFFFF8800".."You are not in a party!|r")
end
elseif tbl[2] == "t" or tbl[2] == "test" then
LW_Report("WHISPER")
else
local output
output = ""
for index,value in pairs(lastwords_options["critters"]) do
if value ~= 0 then
if value ==1 then
output = output..value.." "..index..", ";
else
CName = strsub(index,1, -1).."s"
output = output..value.." "..CName..", ";
local CName
if strsub(index, -1) == "y" then
CName = strsub(index,1, -1).."ies"
elseif strsub(index, -2) == "ch" then
CName = index.."es"
else
CName = strsub(index,1, -1).."s"
output = output..value.." "..CName..", ";
end
end
end
end
end
 
if strlen(output)==0 then
output = "|cFFFF8800So far you have mercilessly slaughtered:|r Nothing! Hoorah!";
else
output = strsub(output, 1, -3)
 
output = "|cFFFF8800So far you have slaughtered:|r "..output..". You Rotter!";
if strlen(output)==0 then
output = "|cFFFF8800So far you have mercilessly slaughtered:|r Nothing! Hoorah!";
else
output = strsub(output, 1, -3)
 
output = "|cFFFF8800So far you have slaughtered:|r "..output..". You Rotter!";
end
DEFAULT_CHAT_FRAME:AddMessage(output);
end
DEFAULT_CHAT_FRAME:AddMessage(output);
else
DEFAULT_CHAT_FRAME:AddMessage("|cFFFF8800Last Words accepts the following commands:|r")
DEFAULT_CHAT_FRAME:AddMessage("|cFFFF8800reset:|r Resets all options to their default values.")
120,6 → 139,21
end
end
 
 
function LW_Report(channel)
local index, value
local total = 0
for index,value in pairs(lastwords_options["critters"]) do
total = total + value
end
if total == 0 then
SendChatMessage("Since "..lastwords_options["startdate"].." "..(UnitName("player")).." has not slaughtered a single critter! Hoorah!", channel, nil, (UnitName("player")))
else
SendChatMessage("Since "..lastwords_options["startdate"].." "..(UnitName("player")).." has mercilessly slaughtered no less than "..total.." poor, innocent critters.", channel, nil, (UnitName("player")))
end
end
 
 
local frame = CreateFrame("Frame", "LWFrame");
frame:SetScript("OnEvent", function(self, event, ...) LastWords_OnEvent(event, ...) end);
frame:RegisterEvent("VARIABLES_LOADED");
\ No newline at end of file