/
-- Author: Dirtygurl |
-- License: GNU GPL v3, 29 June 2007 (see LICENSE.txt) |
local DirtyRecruit = {} |
DirtyRecruit.Version = GetAddOnMetadata("DirtyRecruit", "Version") |
local DirtyRecruit = {}; |
DirtyRecruit.Version = GetAddOnMetadata("DirtyRecruit", "Version"); |
DirtyRecruit.LibQTip = LibStub("LibQTip-1.0") |
DirtyRecruit.LibQTip = LibStub("LibQTip-1.0"); |
DirtyRecruit.PerPlayer = |
{ |
InCombat = nil, |
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." |
} |
Ad = nil |
}; |
DirtyRecruit.TimeSinceLastUpdate = 0 |
DirtyRecruit.TimeSinceLastUpdate = 0; |
function DirtyRecruit.Print(msg) |
if DEFAULT_CHAT_FRAME then |
function DirtyRecruit.IsInPVPOrInstance() |
local instance = IsInInstance() |
local zone = GetZoneText() |
if instance ~= nil or zone == "Wintergrasp" then |
if instance ~= nil or zone == DIRTYRECRUIT_ZONE_WINTERGRASP then |
return 1 |
end |
return nil |
local gName = GetGuildInfo("player") |
if gName then |
local iIndex = nil |
local genIndex, nGeneral = GetChannelName("General - "..GetZoneText()) |
local trdIndex, nTrade = GetChannelName("Trade - City") |
local grIndex, nGuildRecruitment = GetChannelName("GuildRecruitment - City") |
local lfgIndex, nLookingForGroup = GetChannelName("LookingForGroup") |
local ldeIndex, nLocalDefense = GetChannelName("LocalDefense - "..GetZoneText()) |
local genIndex, nGeneral = GetChannelName(DIRTYRECRUIT_CHANNEL_GENERAL.." - "..GetZoneText()) |
local trdIndex, nTrade = GetChannelName(DIRTYRECRUIT_CHANNEL_TRADE.." - City") |
local grIndex, nGuildRecruitment = GetChannelName(DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT.." - City") |
local lfgIndex, nLookingForGroup = GetChannelName(DIRTYRECRUIT_CHANNEL_LOOKINGFORGROUP) |
local ldeIndex, nLocalDefense = GetChannelName(DIRTYRECRUIT_CHANNEL_LOCALDEFENSE.." - "..GetZoneText()) |
if nLocalDefense and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "lde") then |
iIndex = ldeIndex |
elseif nLookingForGroup and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "lfg") then |
-- UpdateInterval |
DirtyRecruit.EditBox_UpdateInterval:SetNumber(DirtyRecruit.PerPlayer.UpdateInterval) |
-- Ad |
DirtyRecruit.EditBox_Ad:SetText(DirtyRecruit.PerPlayer.Ad) |
if (DirtyRecruit.PerPlayer.Ad == nil) then |
DirtyRecruit.PerPlayer.Ad = DIRTYRECRUIT_PERPLAYER_AD; |
end |
DirtyRecruit.EditBox_Ad:SetText(DirtyRecruit.PerPlayer.Ad); |
-- |
DirtyRecruit.Panel.shown = true |
end |
end |
-- Spam |
DirtyRecruit.PerPlayer.Spam = UIDropDownMenu_GetSelectedValue(DirtyRecruit.Menu_Spam) |
local grIndex = GetChannelName("GuildRecruitment - City") |
local ldeIndex = GetChannelName("LocalDefense - "..GetZoneText()) |
local grIndex = GetChannelName(DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT.." - City") |
local ldeIndex = GetChannelName(DIRTYRECRUIT_CHANNEL_LOCALDEFENSE.." - "..GetZoneText()) |
if DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "guild" or DirtyRecruit.PerPlayer.Spam == "lde" then |
if grIndex == 0 and DirtyRecruit.PerPlayer.Spam == "guild" then |
JoinChannelByName("GuildRecruitment") |
JoinChannelByName(DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT) |
elseif ldeIndex == 0 and DirtyRecruit.PerPlayer.Spam == "lde" then |
JoinChannelByName("LocalDefense") |
JoinChannelByName(DIRTYRECRUIT_CHANNEL_LOCALDEFENSE) |
end |
elseif grIndex > 0 and DirtyRecruit.PerPlayer.Spam == "guild" then |
LeaveChannelByName("GuildRecruitment") |
LeaveChannelByName(DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT) |
elseif ldeIndex > 0 and DirtyRecruit.PerPlayer.Spam == "lde" then |
LeaveChannelByName("LocalDefense") |
LeaveChannelByName(DIRTYRECRUIT_CHANNEL_LOCALDEFENSE) |
end |
-- UpdateInterval |
local UpdateInterval = DirtyRecruit.EditBox_UpdateInterval:GetNumber() |
else |
DirtyRecruit.Print("no advertisement was found") |
end |
elseif cmd == "on" then |
DirtyRecruit.PerPlayer.Active = true |
DirtyRecruit.UpdateSettings() |
elseif cmd == "off" then |
DirtyRecruit.PerPlayer.Active = nil |
DirtyRecruit.UpdateSettings() |
else |
DirtyRecruit.Print("DirtyRecruit v"..DirtyRecruit.Version) |
DirtyRecruit.Print("Syntax: |cffffff7f/dirtyrecruit <command> <args>|r") |
DirtyRecruit.Print(" |cff00ff00v|version|r - Shows addon version.") |
DirtyRecruit.Print(" |cff00ff00on|off|r - Enable/disable advertising.") |
DirtyRecruit.Print(" |cff00ff00config|r - Shows the configuration panel.") |
DirtyRecruit.Print(" |cff00ff00reset|r - Resets all data to original.") |
DirtyRecruit.Print(" |cff00ff00sync <character>|r - Syncs data from a character.") |
## Interface: 30200 |
## Interface: 30300 |
## Title: DirtyRecruit |
## Author: Dirtygurl |
## Version: 1.0.3 |
## Version: 1.0.4 |
## Notes: Automatic guild recruitment spam. |
## SavedVariables: DirtyRecruitGlobal |
libs\LibQTip\LibQTip-1.0.lua |
libs\ChatThrottleLib\ChatThrottleLib.lua |
locale\enUS.lua |
locale\frFR.lua |
DirtyRecruit.lua |
DIRTYRECRUIT_TITLE = "Dirty Recruit"; |
DIRTYRECRUIT_SUBTITLE = "Instance Map Browser"; |
DIRTYRECRUIT_DESC = "Atlas is an instance map browser."; |
DIRTYRECRUIT_SLASH = "/dirtyrecruit"; |
DIRTYRECRUIT_SLASH_OPTIONS = "options"; |
DIRTYRECRUIT_STRING_LOCATION = "Location"; |
DIRTYRECRUIT_OPTIONS_BUTTON = "Options"; |
DIRTYRECRUIT_BUTTON_TOOLTIP_TITLE = "Atlas"; |
DIRTYRECRUIT_ZONE_WINTERGRASP = "Wintergrasp"; |
DIRTYRECRUIT_PERPLAYER_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."; |
DIRTYRECRUIT_CHANNEL_GENERAL = "General"; |
DIRTYRECRUIT_CHANNEL_TRADE = "Trade"; |
DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT = "GuildRecruitment"; |
DIRTYRECRUIT_CHANNEL_LOOKINGFORGROUP = "LookingForGroup"; |
DIRTYRECRUIT_CHANNEL_LOCALDEFENSE = "LocalDefense"; |
if (GetLocale() ~= "frFR") then |
DIRTYRECRUIT_TITLE = "Dirty Recruit"; |
DIRTYRECRUIT_SUBTITLE = "Instance Map Browser"; |
DIRTYRECRUIT_DESC = "Atlas is an instance map browser."; |
DIRTYRECRUIT_SLASH = "/dirtyrecruit"; |
DIRTYRECRUIT_SLASH_OPTIONS = "options"; |
DIRTYRECRUIT_STRING_LOCATION = "Location"; |
DIRTYRECRUIT_OPTIONS_BUTTON = "Options"; |
DIRTYRECRUIT_BUTTON_TOOLTIP_TITLE = "Atlas"; |
DIRTYRECRUIT_ZONE_WINTERGRASP = "Joug d'Hiver"; |
DIRTYRECRUIT_PERPLAYER_AD = "--MyGuild-- recrute des joueurs de tous niveaux pour les groupes et le contenu du jeu final. Nous disposons d'un tabard de guilde, Vent, et le site Web TVP si vous voulez rejoindre certains des meilleurs joueurs de the game."; |
DIRTYRECRUIT_CHANNEL_GENERAL = "Général"; |
DIRTYRECRUIT_CHANNEL_TRADE = "Commerce"; |
DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT = "RecrutementDeGuilde"; |
DIRTYRECRUIT_CHANNEL_LOOKINGFORGROUP = "RechercheDeGroupe"; |
DIRTYRECRUIT_CHANNEL_LOCALDEFENSE = "DéfenseLocale"; |
end; |