More languages
More actions
mNo edit summary Tag: Reverted |
mNo edit summary Tag: Reverted |
||
Line 19: | Line 19: | ||
end | end | ||
while (rnd < a) do | while (rnd < a) do | ||
rnd = math.ceil((rnd* | rnd = math.ceil((rnd*1.5)*((math.random(a,b)/100) + 1)) | ||
math.randomseed(rnd) | math.randomseed(rnd) | ||
end | end |
Revision as of 00:30, 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 * math.random(1,10000)
while (rnd > b) do
rnd = math.floor(rnd/b) * math.random(a,b)
math.randomseed(rnd)
end
while (rnd < a) do
rnd = math.ceil((rnd*1.5)*((math.random(a,b)/100) + 1))
math.randomseed(rnd)
end
return rnd
end
return p