本站页面(多半)转载自萌娘百科的同名页面,依CC BY-NC-SA 3.0引入,贡献者可以在历史页查询。
因各种原因页面内容可能和源页面有所出入,非本站特有页面内容请以萌娘百科为准。
因各种原因页面内容可能和源页面有所出入,非本站特有页面内容请以萌娘百科为准。
- 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
- 本镜像站和其他萌娘百科的镜像站无关,请注意分别。
Module:Sandbox/一条茧
跳到导航
跳到搜索
function test() n = random(10) m = random(10,20) s = f[[{{color|#66ccff|$n}} <b> $m, $nnnil </b> ]] code = read('U:一条茧') return _(f'$s$code<pre>$code</pre>') end x = '{{color|#66ccff|aaa}} <b>bbb</b>' function a() return x end function b() return _('{{PAGENAME}}') == 'Sandbox/一条茧' and _(x) or x end -------- function tip() tips = {} for i in read('U:一条茧/tips'):gsub('==END==.*',''):gmatch('#[^\n]*') do tips[#tips+1] = i:sub(2) end return tips[random(#tips)] end function sign() color = '#7F8070' return f'[[U:一条茧|<i style=color:$color>一条茧</i>]]' end -------- function f(s, t) t = t or _G return (s:gsub("%$[a-zA-Z0-9_]*", function(block) local key, fmt = block:match("%$([a-zA-Z0-9_]*)") local val = t[key] return tostring(val == nil and '$'..key or val) end)) end function _(s, t) s = t and s or s:gsub('\n%s*', '') return mw and mw.getCurrentFrame():preprocess(s) or s end function read(page) return mw and mw.title.new(page):getContent() or '' end _random_seed = 0.1 function random(a,b) a, b = a or 65536, b or 1 if a > b then a,b = b,a end _random_seed = tonumber('0.'..tostring(os.clock()*2^_random_seed):sub(3):reverse()) return a+math.floor(_random_seed*(b-a)) end return mw and _G or print(test())