Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:RemiLib
(view source)
Revision as of 04:43, 25 October 2015
86 bytes added
,
9 years ago
no edit summary
Line 24:
Line 24:
function p.timeHash(seed)
function p.timeHash(seed)
local randomizer = 0
local randomizer = 0
−
if type(seed) == "table" then
+
+
mw.log(type(seed))
+
+
if
seed == nil then
+
randomizer = math.random(0,9999999)
+
elseif
type(seed) == "table" then
for k,v in pairs(dict) do
for k,v in pairs(dict) do
randomizer = randomizer + p.hashString(k)
randomizer = randomizer + p.hashString(k)
Line 34:
Line 39:
end
end
end
end
−
end
+
elseif
type(seed) == "string" then
−
if
type(seed) == "string" then
randomizer = p.hashString(seed)
randomizer = p.hashString(seed)
−
end
+
elseif
type(seed) == "number" then
−
if
type(seed) == "number" then
randomizer = seed
randomizer = seed
end
end
Remi Scarlet
2,922
edits