# HG changeset patch # User ovolkov # Date 1421858438 -10800 # Node ID c8e6f44df4170dbad8a91b3c66cfc2656966bd2d # Parent d88ea0fdc19ce48582ce29f2701db116294360b3 no longer using slash commands diff -r d88ea0fdc19c -r c8e6f44df417 Slash.lua --- a/Slash.lua Wed Jan 21 19:19:13 2015 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -local aName, aEnv = ... - -local strchar = string.char -local strbyte = string.byte -local random = random -local strsub = strsub -local tonumber = tonumber - -local function UniqSlashID(base, maxNumber) - local clear = true - for idx = 1, maxNumber do - if _G["SLASH_" .. base .. idx] then clear = false break end - end - if SlashCmdList[base] then clear = false end - if clear then return base end - return UniqSlashID(base .. (strchar(random(strbyte('a'), strbyte('z')))), maxNumber) -end - -local slashID - -slashID=UniqSlashID("LFGActivityFilter", 1) -_G["SLASH_" .. slashID .. "1"] = "/lfgaf" -SlashCmdList[slashID] = function(activities) - wipe(aEnv.LFGFilter_Allow_Activity) - local count = 0 - for activity in string.gmatch(activities, "[^ ]+") do - local activity_id = tonumber(activity) - local activity_name - if activity_id then activity_name = C_LFGList.GetActivityInfo(activity_id) end - if activity_name then - print("Adding wanted activity to filter: ", activity_name) - aEnv.LFGFilter_Allow_Activity[activity_id] = true - count = count + 1 - else - print("Can't parse activity ID or it doesn't match known activity: ", activity_id) - end - end - aEnv.LFGFilter_Allow_Activity.count = count - if count > 0 then - print("Activities in filter: ", count) - else - print("Filters removed.") - end -end - -slashID=UniqSlashID("LFGActivityList", 1) -_G["SLASH_" .. slashID .. "1"] = "/lfgal" -SlashCmdList[slashID] = function() - for activity_id = 1, 10000 do - local activity_name = C_LFGList.GetActivityInfo(activity_id) - if activity_name then - print(activity_id, activity_name) - end - end -end \ No newline at end of file