Moduł:Brudnopis/Keyacom/0-255

Z Wikipedii, wolnej encyklopedii

Dokumentacja dla tego modułu może zostać utworzona pod nazwą Moduł:Brudnopis/Keyacom/0-255/opis

-- Truly random numbers Lua made by Ice Scripter--
-- This program may be updated overtime --
-- Put "random()" to use the truly random number.
-- v# 2.0 --

-- Don't worry about code between these lines --

local u = 0 -- don't delete

local function random(x, y)
    u = u + 1
    if x ~= nil and y ~= nil then
        return math.floor(x +(math.random(math.randomseed(os.time()+u))*999999 %y))
    else
        return math.floor((math.random(math.randomseed(os.time()+u))*100))
    end
end

-- Example --

for i = 1, 10 do
    print(random(0, 255)) -- Call the random number genorator by doing this
end