Module

DYK

From Dogcraft Wiki

(Difference between pages)
No edit summary
 
(Create user page)
 
Line 1: Line 1:
local p = {} --p stands for package
{{Tab Userpage}}
{{Infobox Player
|aliases        =
|join_date      = Edit this!
|activity        = {{Active}}
|role            =
|groups          =
|builds          = Edit this!
|projects        =
|bases          =
|accomplishments =
}}
Hello, I am '''MacksawJoe'''!


function p.random( frame )
== About me ==
    if (frame.args['mode'] == "multiply") then
Write about yourself!
    seed = os.date("%d")*os.date("%m")*os.date("%y")
    else
    seed = os.date("%d")+os.date("%m")+os.date("%y")
    end
    math.randomseed(seed)
length = frame.args['lenght'] or 30
randnum = math.random(1,length)
    return randnum
end


function randomdaily( maxrandom, seed )
== On Dogcraft ==
    math.randomseed(seed)
* Write about what you have done!
length = maxrandom or 30
randnum = math.random(1,length)
    return randnum
end
 
function p.facts( frame )
text = frame.args['text'] or ""
    facts = {}
i = 1
result = ""
resulttable = {}
for fact in string.gmatch(text, '%* %.%.%. .-?') do
facts[i] = fact
i = i + 1
end
count = 1
count = tonumber(frame.args['count']) or 1
if (count > 5) then
count = 5
elseif (count < 1) then
count = 1
end
for i=1,count do
key = randomdaily(facts.getn, os.date("%d")*os.date("%m")*os.date("%y")*count)
resulttable[i] = facts[key]
end
result = table.concat(resulttable, "\n")
return result
end
 
return p

Latest revision as of 18:55, 1 April 2021


MacksawJoe
5d2b4d08-f4ab-4bc0-bd0b-62b90cc1551b?overlay=true.png

Player
JoinedEdit this!
ActivityActive
Server Rank[default]
Profile

Hello, I am MacksawJoe!

About me

Write about yourself!

On Dogcraft

  • Write about what you have done!