Module:DYK empty prep slots: Difference between revisions
Jump to navigation
Jump to search
wp>Theleekycauldron + |
RandomUser34 (talk | contribs) m 1 revision imported |
(No difference)
| |
Latest revision as of 10:43, 17 February 2026
Documentation for this module may be created at Module:DYK empty prep slots/doc
local p = {};
p.num_empty = function(prep)
_, count = string.gsub(prep, "{{DYKmake|Example|Editor|subpage=", "{{DYKmake|Example|Editor|subpage=")
return count
end
p.prepfill = function(frame)
bottom_prep = (tonumber(string.sub(mw.title.new("Did you know/Queue/NextPrep",10):getContent(),1,1))-2)%7+1 --will break if number of preps goes to double digits
total = 0;
for i=1,7 do
if i ~= bottom_prep then
page = mw.title.new("Did you know/Preparation area "..i,10):getContent();
total = total + p.num_empty(page);
end
end
return total
end
return p;