• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
no edit summary
Line 30: Line 30:  
function p.timeHash(seed)
 
function p.timeHash(seed)
 
local randomizer = 0
 
local randomizer = 0
  −
mw.log("Aaaaaaa")
  −
mw.log(type(seed))
  −
mw.log(seed)
   
 
 
if seed == nil then
 
if seed == nil then
mw.log("asdf")
   
randomizer = math.random(0,9999999)
 
randomizer = math.random(0,9999999)
 
elseif type(seed) == "table" then
 
elseif type(seed) == "table" then
Line 42: Line 37:  
randomizer = math.random(0,9999999)
 
randomizer = math.random(0,9999999)
 
else
 
else
mw.log("fdsa")
   
for k,v in pairs(seed) do
 
for k,v in pairs(seed) do
 
randomizer = randomizer + p.hashString(k)
 
randomizer = randomizer + p.hashString(k)
Line 60: Line 54:  
local time = os.time()
 
local time = os.time()
 
local rand = math.random(-1,1)
 
local rand = math.random(-1,1)
mw.log(randomizer)
+
 
mw.log(rand)
  −
mw.log(time)
  −
mw.log("fdsa")
   
return (math.floor(time*265314426625821*rand)-randomizer) % 2^32+math.floor(math.random(-1,1)*1381242451)
 
return (math.floor(time*265314426625821*rand)-randomizer) % 2^32+math.floor(math.random(-1,1)*1381242451)
 
end
 
end
2,922

edits

Navigation menu