Module:Random and Module:Random/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
allow newline separators |
Simplified code |
||
Line 110: | Line 110: | ||
startTimestamp = '@' .. tostring(currentYearStartUnix) -- @ is used to denote Unix timestamps with lang:formatDate. |
startTimestamp = '@' .. tostring(currentYearStartUnix) -- @ is used to denote Unix timestamps with lang:formatDate. |
||
endTimestamp = '@' .. tostring(currentYearEndUnix) |
endTimestamp = '@' .. tostring(currentYearEndUnix) |
||
elseif |
elseif not t2 then |
||
startTimestamp = '@0' -- the Unix epoch, 1 January 1970 |
startTimestamp = '@0' -- the Unix epoch, 1 January 1970 |
||
endTimestamp = t1 |
endTimestamp = t1 |
||
⚫ | |||
⚫ | |||
startTimestamp = t1 |
startTimestamp = t1 |
||
endTimestamp = t2 |
endTimestamp = t2 |
||
Line 264: | Line 264: | ||
-- This is because of the variability of os.clock (the time in seconds that the Lua script has been running for). |
-- This is because of the variability of os.clock (the time in seconds that the Lua script has been running for). |
||
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000)) |
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000)) |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
else |
else |
||
⚫ | |||
if not cfg.lowTraffic then |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
end |
|||
end |
|||
if type(args) ~= 'table' then |
|||
⚫ | |||
end |
end |
||
⚫ | |||
return l[funcName](args, listType) |
return l[funcName](args, listType) |
||
end |
end |