/
{ |
Active = nil, |
InCombat = nil, |
Spam = "all", |
Spam = "guild", |
UpdateInterval = 300.0, -- 5 minutes |
Ad = "--MyGuild-- is recruiting any level players for groups and end game content. We have a Guild Tabard, Vent, and Website PST if you want to join some of the best players in the game." |
} |
local iIndex = nil |
local _, nGeneral = GetChannelName(1) |
local _, nTrade = GetChannelName(2) |
if nTrade and nTrade:match("^Trade - ") and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "major") then |
local _, nGuildRecruitment = GetChannelName(6) |
if nGuildRecruitment and nGuildRecruitment:match("^Guild") and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "recruit") then |
iIndex = 6 |
elseif nTrade and nTrade:match("^Trade") and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "trade") then |
iIndex = 2 |
elseif nGeneral and nGeneral:match("^General - ") and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "general") then |
-- Note: blah, too lazy to do it a proper way |
if nTrade and nTrade:match("^Trade - ") then |
iIndex = nil |
else |
iIndex = 1 |
end |
elseif nGeneral and nGeneral:match("^General") and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "general") then |
iIndex = 1 |
elseif nTrade and nTrade:match("^Trade") and nGeneral and nGeneral:match("^General") and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "major") then |
iIndex = 1 |
end |
if iIndex ~= nil then |
--DirtyRecruit.Print(iIndex..": "..DirtyRecruit.PerPlayer.Ad) |
function DirtyRecruit.OnVariablesLoaded() |
--DirtyRecruit.Print("OnEvent:VARIABLES_LOADED") |
--[[ |
-- Updated Variables |
--]] |
if not DirtyRecruitPerPlayer.Spam then |
DirtyRecruitPerPlayer.Spam = "all" |
end |
--[[ |
-- Global Variables |
--]] |
if not DirtyRecruitGlobal then |
if not DirtyRecruitPerPlayer then |
DirtyRecruitPerPlayer = DirtyRecruit.PerPlayer |
end |
--[[ |
-- Updated Variables |
--]] |
if not DirtyRecruitPerPlayer.Spam then |
DirtyRecruitPerPlayer.Spam = DirtyRecruit.PerPlayer.Spam |
end |
DirtyRecruit.Global = DirtyRecruitGlobal |
DirtyRecruit.PerPlayer = DirtyRecruitPerPlayer |
end |
end |
elseif cmd == "spam" and arg then |
local uSpam = strlower(arg) |
if uSpam == "all" or uSpam == "major" or uSpam == "general" then |
if uSpam == "all" or uSpam == "guild" or uSpam == "trade" or uSpam == "major" or uSpam == "general" then |
DirtyRecruit.Print("spam set to "..uSpam) |
DirtyRecruit.PerPlayer.Spam = uSpam |
DirtyRecruit.UpdateSettings() |
## Title: DirtyRecruit |
## Author: Dirtygurl |
## Version: 1.0-a1 |
## Version: 1.0-a2 |
## Notes: Automatic guild recruitment spam. |
## SavedVariables: DirtyRecruitGlobal |
## SavedVariablesPerCharacter: DirtyRecruitPerPlayer |