Module:CheckUser requests at UTRS
Appearance
![]() | This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
This module returns the current number of requests for CheckUser attention at UTRS. It takes no parameters.
It it used in {{CheckUser requests at UTRS}}, which outputs a banner with a button to log in to UTRS.
The data are collected from User:AmandaNP/UTRS Appeals.
Usage
{{#invoke:CheckUser requests at UTRS|main}}
local p = {}
function p.main(args)
local UTRS = mw.title.new('User:AmandaNP/UTRS Appeals').content -- get the UTRS table
local numberEncountered = 0 -- initialize the counter
local currentStartIndex = 1 -- initialize the index
while true do
-- find the next occurance of 'CHECKUSER'
local nextMatchRange = string.find(UTRS, 'CHECKUSER', currentStartIndex, true)
if not nextMatchRange then
-- we did not find any occurances, so return the current count
return tostring(numberEncountered)
else
-- we found the next match, so increment the numberEncountered and update the currentStartIndex
numberEncountered = numberEncountered + 1
currentStartIndex = math.max(nextMatchRange)
end
end
end