More languages
More actions
mNo edit summary Tag: Reverted |
mNo edit summary Tag: Reverted |
||
Line 11: | Line 11: | ||
local m = Date:match("%d+:(%d+):%d+") | local m = Date:match("%d+:(%d+):%d+") | ||
local s = Date:match("%d+:%d+:(%d+)") | local s = Date:match("%d+:%d+:(%d+)") | ||
local rnd = | local rnd = s * s * m * h | ||
while (rnd > b) do | while (rnd > b) do | ||
Line 17: | Line 17: | ||
end | end | ||
while (rnd < a) do | while (rnd < a) do | ||
rnd = math.floor(rnd*1.76) | rnd = math.floor(rnd*1.76) | ||
end | end | ||
return rnd | return rnd | ||
end | end | ||
return p | return p |
Revision as of 00:07, 6 October 2022
local p = {}
function p.random(frame)
local parent = frame:getParent()
local a = tonumber(parent.args[1]) or 1
local b = tonumber(parent.args[2]) or 100
local Date = os.date()
local h = Date:match("(%d+):%d+:%d+")
local m = Date:match("%d+:(%d+):%d+")
local s = Date:match("%d+:%d+:(%d+)")
local rnd = s * s * m * h
while (rnd > b) do
rnd = math.floor(rnd/b)
end
while (rnd < a) do
rnd = math.floor(rnd*1.76)
end
return rnd
end
return p