WoWInterface SVN DirtyRecruit

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 20 to Rev 19
    Reverse comparison

Rev 20 → Rev 19

trunk/DirtyRecruit/DirtyRecruit.toc
2,7 → 2,7
 
## Title: DirtyRecruit
## Author: Dirtygurl
## Version: 1.0.4a
## Version: 1.0.4
## Notes: Automatic guild recruitment spam.
 
## SavedVariables: DirtyRecruitGlobal
trunk/DirtyRecruit/locale/frFR.lua
1,8 → 1,8
if (GetLocale() ~= "frFR") then return; end;
if (GetLocale() ~= "frFR") then
 
DIRTYRECRUIT_TITLE = "Dirty Recruit";
DIRTYRECRUIT_SUBTITLE = "...";
DIRTYRECRUIT_DESC = "...";
DIRTYRECRUIT_SUBTITLE = "Instance Map Browser";
DIRTYRECRUIT_DESC = "Atlas is an instance map browser.";
DIRTYRECRUIT_SLASH = "/dirtyrecruit";
DIRTYRECRUIT_SLASH_OPTIONS = "options";
DIRTYRECRUIT_STRING_LOCATION = "Location";
15,8 → 15,5
DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT = "RecrutementDeGuilde";
DIRTYRECRUIT_CHANNEL_LOOKINGFORGROUP = "RechercheDeGroupe";
DIRTYRECRUIT_CHANNEL_LOCALDEFENSE = "DéfenseLocale";
DIRTYRECRUIT_GENERAL = "Général";
DIRTYRECRUIT_TRADE = "Commerce";
DIRTYRECRUIT_GUILDRECRUITMENT = "Recrutement De Guilde";
DIRTYRECRUIT_LOOKINGFORGROUP = "Recherche De Groupe";
DIRTYRECRUIT_LOCALDEFENSE = "Défense Locale";
\ No newline at end of file + +end; \ No newline at end of file
trunk/DirtyRecruit/locale/enUS.lua
1,6 → 1,6
DIRTYRECRUIT_TITLE = "Dirty Recruit";
DIRTYRECRUIT_SUBTITLE = "...";
DIRTYRECRUIT_DESC = "...";
DIRTYRECRUIT_SUBTITLE = "Instance Map Browser";
DIRTYRECRUIT_DESC = "Atlas is an instance map browser.";
DIRTYRECRUIT_SLASH = "/dirtyrecruit";
DIRTYRECRUIT_SLASH_OPTIONS = "options";
DIRTYRECRUIT_STRING_LOCATION = "Location";
13,8 → 13,3
DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT = "GuildRecruitment";
DIRTYRECRUIT_CHANNEL_LOOKINGFORGROUP = "LookingForGroup";
DIRTYRECRUIT_CHANNEL_LOCALDEFENSE = "LocalDefense";
DIRTYRECRUIT_GENERAL = "General";
DIRTYRECRUIT_TRADE = "Trade";
DIRTYRECRUIT_GUILDRECRUITMENT = "Guild Recruitment";
DIRTYRECRUIT_LOOKINGFORGROUP = "Looking For Group";
DIRTYRECRUIT_LOCALDEFENSE = "Local Defense";
trunk/DirtyRecruit/DirtyRecruit.lua
13,13 → 13,10
InCombat = nil,
Spam = "guild",
UpdateInterval = 300.0, -- 5 minutes
Ad = nil,
TestMode = nil,
Zone = nil
Ad = nil
};
 
DirtyRecruit.TimeSinceLastUpdate = 0;
DirtyRecruit.TimeSinceLastCheck = 0;
 
function DirtyRecruit.Print(msg)
if DEFAULT_CHAT_FRAME then
36,45 → 33,6
return nil
end
 
function DirtyRecruit.AdvertiseTest()
local gName = GetGuildInfo("player")
if gName then
local iIndex = nil
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
iValue = nLocalDefense
elseif nLookingForGroup and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "lfg") then
iIndex = lfgIndex
iValue = nLookingForGroup
elseif nGuildRecruitment and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "guild") then
iIndex = grIndex
iValue = nGuildRecruitment
elseif DirtyRecruit.PerPlayer.Zone == "City" and nTrade and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "trade") then
iIndex = trdIndex
iValue = nTrade
elseif DirtyRecruit.PerPlayer.Zone == "City" and nGeneral and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "general") then
iIndex = genIndex
iValue = nGeneral
elseif nTrade and nGeneral and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "major") then
iIndex = trdIndex
iValue = nTrade
end
if iIndex ~= nil and DirtyRecruit.PerPlayer.Zone ~= nil then
if DirtyRecruit.TestMode ~= nil then
DirtyRecruit.Print("["..iIndex..". "..iValue.."]: "..DirtyRecruit.PerPlayer.Ad)
else
ChatThrottleLib:SendChatMessage("NORMAL", "DirtyRecruit", DirtyRecruit.PerPlayer.Ad, "CHANNEL", nil, iIndex)
ChatThrottleLib:SendAddonMessage("NORMAL", "DirtyRecruit", "guildAdvertised|"..DirtyRecruit.PerPlayer.Zone.."|"..UnitName("player"), "GUILD")
end
end
end
end
 
function DirtyRecruit.Advertise()
local gName = GetGuildInfo("player")
if gName then
86,30 → 44,21
local ldeIndex, nLocalDefense = GetChannelName(DIRTYRECRUIT_CHANNEL_LOCALDEFENSE.." - "..GetZoneText())
if nLocalDefense and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "lde") then
iIndex = ldeIndex
iValue = nLocalDefense
elseif nLookingForGroup and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "lfg") then
iIndex = lfgIndex
iValue = nLookingForGroup
elseif nGuildRecruitment and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "guild") then
iIndex = grIndex
iValue = nGuildRecruitment
elseif DirtyRecruit.PerPlayer.Zone == "City" and nTrade and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "trade") then
elseif nTrade and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "trade") then
iIndex = trdIndex
iValue = nTrade
elseif DirtyRecruit.PerPlayer.Zone == "City" and nGeneral and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "general") then
elseif nGeneral and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "general") then
iIndex = genIndex
iValue = nGeneral
elseif nTrade and nGeneral and (DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "major") then
iIndex = trdIndex
iValue = nTrade
end
if iIndex ~= nil and DirtyRecruit.PerPlayer.Zone ~= nil then
if DirtyRecruit.PerPlayer.TestMode ~= nil then
DirtyRecruit.Print("["..iIndex..". "..iValue.."]: "..DirtyRecruit.PerPlayer.Ad)
else
ChatThrottleLib:SendChatMessage("NORMAL", "DirtyRecruit", DirtyRecruit.PerPlayer.Ad, "CHANNEL", nil, iIndex)
ChatThrottleLib:SendAddonMessage("NORMAL", "DirtyRecruit", "guildAdvertised|"..DirtyRecruit.PerPlayer.Zone.."|"..UnitName("player"), "GUILD")
end
if iIndex ~= nil then
--DirtyRecruit.Print(iIndex..": "..DirtyRecruit.PerPlayer.Ad)
ChatThrottleLib:SendChatMessage("NORMAL", "DirtyRecruit", DirtyRecruit.PerPlayer.Ad, "CHANNEL", nil, iIndex)
ChatThrottleLib:SendAddonMessage("NORMAL", "DirtyRecruit", "guildAdvertised|DR|"..GetZoneText().."|DR|"..UnitName("player"), "GUILD")
end
end
end
297,7 → 246,7
DirtyRecruit.PerPlayer.Spam = UIDropDownMenu_GetSelectedValue(DirtyRecruit.Menu_Spam)
local grIndex = GetChannelName(DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT.." - City")
local ldeIndex = GetChannelName(DIRTYRECRUIT_CHANNEL_LOCALDEFENSE.." - "..GetZoneText())
if DirtyRecruit.PerPlayer.Zone == "City" and DirtyRecruit.PerPlayer.Spam == "all" or DirtyRecruit.PerPlayer.Spam == "guild" or DirtyRecruit.PerPlayer.Spam == "lde" then
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(DIRTYRECRUIT_CHANNEL_GUILDRECRUITMENT)
elseif ldeIndex == 0 and DirtyRecruit.PerPlayer.Spam == "lde" then
326,21 → 275,13
InCombat = nil,
Spam = "guild",
UpdateInterval = 300.0, -- 5 minutes
Ad = nil,
TestMode = nil,
Zone = nil
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.Panel_OnShow()
end
 
function DirtyRecruit.OnUpdateSpam(self, elapsed)
--DirtyRecruit.Print("OnUpdate")
local CityInterval = tonumber(30)
DirtyRecruit.TimeSinceLastCheck = DirtyRecruit.TimeSinceLastCheck + elapsed
if DirtyRecruit.TimeSinceLastCheck and DirtyRecruit.TimeSinceLastCheck >= CityInterval then
DirtyRecruit.ZoneChangedNewArea()
DirtyRecruit.TimeSinceLastCheck = 0
end
local UpdateInterval = tonumber(DirtyRecruit.PerPlayer.UpdateInterval)
DirtyRecruit.TimeSinceLastUpdate = DirtyRecruit.TimeSinceLastUpdate + elapsed
if DirtyRecruit.TimeSinceLastUpdate and DirtyRecruit.TimeSinceLastUpdate >= UpdateInterval then
361,32 → 302,16
DirtyRecruit.PerPlayer.InCombat = nil
end
 
function DirtyRecruit.ZoneChangedNewArea()
--DirtyRecruit.Print("OnEvent:ZONE_CHANGED_NEW_AREA")
DirtyRecruit.PerPlayer.Zone = nil
local currchans = {GetChannelList()}
for i=2,#currchans,2 do
if currchans[i] ~= nil and currchans[i] == "Trade" and (DirtyRecruit.PerPlayer.Spam == "trade" or DirtyRecruit.PerPlayer.Spam == "major") then
-- If we have a trade chan we are in a city
DirtyRecruit.PerPlayer.Zone = "City"
end
end
if DirtyRecruit.PerPlayer.Zone ~= "City" then
DirtyRecruit.PerPlayer.Zone = GetZoneText()
end
--DirtyRecruit.Print("Zone Changed: "..DirtyRecruit.PerPlayer.Zone)
end
 
function DirtyRecruit.OnChatMsgAddOn(action)
--DirtyRecruit.Print("OnEvent:CHAT_MSG_ADDON")
local a, b, c = strsplit("|", action)
local a, b, c = strsplit("|DR|", action)
if a == "guildAdvertised" and b == GetZoneText() and c ~= UnitName("player") then
DirtyRecruit.Print("Guild Advertised, Reset on timer has been issued")
DirtyRecruit.TimeSinceLastUpdate = 0
end
if a == "guildSync" and b then
DirtyRecruit.Print("Sync request from "..b)
ChatThrottleLib:SendAddonMessage("NORMAL", "DirtyRecruit", "guildSynced|"..DirtyRecruit.PerPlayer.Ad, "WHISPER", b)
ChatThrottleLib:SendAddonMessage("NORMAL", "DirtyRecruit", "guildSynced|DR|"..DirtyRecruit.PerPlayer.Ad, "WHISPER", b)
end
if a == "guildSynced" and b then
DirtyRecruit.PerPlayer.Ad = b
429,8 → 354,6
DirtyRecruit.OnPlayerRegenDisabled()
elseif event == "PLAYER_REGEN_ENABLED" then
DirtyRecruit.OnPlayerRegenEnabled()
elseif event == "ZONE_CHANGED_NEW_AREA" then
DirtyRecruit.ZoneChangedNewArea()
elseif event == "CHAT_MSG_ADDON" and arg1 == "DirtyRecruit" then
DirtyRecruit.OnChatMsgAddOn(arg2)
elseif event == "VARIABLES_LOADED" then
463,17 → 386,9
elseif cmd == "sync" then
DirtyRecruit.Print("Requested sync from "..arg)
ChatThrottleLib:SendAddonMessage("NORMAL", "DirtyRecruit", "guildSync|DR|"..UnitName("player"), "WHISPER", arg)
elseif cmd == "testmode" then
if DirtyRecruit.PerPlayer.TestMode ~= nil then
DirtyRecruit.TestMode = nil
DirtyRecruit.Print("Test mode off")
else
DirtyRecruit.TestMode = 1
DirtyRecruit.Print("Test mode on")
end
elseif cmd == "test" then
if DirtyRecruit.PerPlayer.Ad then
DirtyRecruit.AdvertiseTest()
DirtyRecruit.Print(DirtyRecruit.PerPlayer.Ad)
else
DirtyRecruit.Print("no advertisement was found")
end
502,7 → 417,6
DirtyRecruit.Frame = DirtyRecruit.LibQTip:Acquire("DirtyRecruitFrame")
DirtyRecruit.Frame:RegisterEvent("PLAYER_REGEN_DISABLED")
DirtyRecruit.Frame:RegisterEvent("PLAYER_REGEN_ENABLED")
DirtyRecruit.Frame:RegisterEvent("ZONE_CHANGED_NEW_AREA")
DirtyRecruit.Frame:RegisterEvent("CHAT_MSG_ADDON")
DirtyRecruit.Frame:RegisterEvent("VARIABLES_LOADED")
DirtyRecruit.Frame:RegisterEvent("ADDON_LOADED")