Open main menu

Changes

Module:Protection banner

213 bytes added, 00:35, 5 March 2014
try a different category matching algorithm completely
-- Define the key table and the order to test it in
local keyTable = {protType, protLevel, namespace, reason, expiry}
local tryOrderattemptOrder = { {true, true, true, true, true}, {true, true, true, true, false}, {true, true, true, false, true}, {true, true, false, true, true}, {true, true, true, false, false}, {true, true, false, true, false}, if reason == 'vandalism' then {true, true, false, false, true}, tryOrder = {5true, 4true, 3false, 2false, 1false}, else {true, false, false, false, false}, tryOrder = {5false, 3false, 4false, 2false, 1false} end}
-- Try successively generic matches until we run out of key combinations
local function attemptMatchfor i, t in ipairs(attemptOrder)do local key = table.concat(keyTable{} for j = 1, '-')5 do return cats if t[j] then key[j] = keyTable[j] end else local attempt key[j] = attemptMatch()'all' if attempt then end return attempt end for i, keyTableKey in ipairs(tryOrder) do keyTable[keyTableKey] key = table.concat(key, 'all-') local attempt = attemptMatch()cats[key]
if attempt then
return attempt
Anonymous user