Module:Aichan:修订间差异

添加320字节 、​ 2024年4月11日 (星期四)
bruh bruh bruh
(bruh bruh)
标签撤销
(bruh bruh bruh)
第16行: 第16行:
randomizer.z=(170*randomizer.z)%30323
randomizer.z=(170*randomizer.z)%30323
return ((randomizer.x/30269+randomizer.y/30307+randomizer.z/30323)%1)
return ((randomizer.x/30269+randomizer.y/30307+randomizer.z/30323)%1)
end
function dateStringToTime(date)
if date==nil then return nil end
local y,m,d = string.match(date, "([^/]+)/([^/]+)/([^/]+)")
return os.time({year=y,month=m,day=d,hour=12,min=30});
end
end


第24行: 第30行:


function p._main(args)
function p._main(args)
-- arg: time, unix 时间戳
-- args:
--  不传入则使用 当前时间
--   time: unix时间戳
local time = args['time'] or os.time()
--    date: YYYY/MM/DD格式的时间, 按这一天的北京时间12:30算
-- 优先级: time > date > 读取 当前时间
local time = args['time'] or dateStringToTime(args['date']) or os.time()
local seed = math.floor((time-144e2)/864e2)
local seed = math.floor((time-144e2)/864e2)
initRandomizer(seed)
initRandomizer(seed)
464

个编辑