Module:RandomQueue: Difference between revisions
Content deleted Content added
m Protected "Module:RandomQueue" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
Line 17:
if (mode == "fa" or mode == "both") then
fa_list = mw.title.new('
--fa_list = fa_list:match(listpatt)
end
if (mode == "ga" or mode == "both") then
ga_list = mw.title.new('
--ga_list = ga_list:match(listpatt)
end
Line 29:
pagename = link:gsub("%[%[(.*)%]%]", "%1")
pagename = pagename:gsub("(.*)%|.*", "%1")
if
list[#list + 1] = pagename
end
Line 40:
math.randomseed(os.time())
num = math.random(1, #list)
pagetext = mw.title.new(list[num]):getContent() or ""
pagetext = pagetext:gsub("%=%=(.*)", "")
filename = pagetext:match(".*%[%[File:(.*)%]%].*")
| |||