有兽档案馆
搜索
切换搜索
切换菜单
切换个人菜单
查看“Module:Awajie”的源代码
来自有兽档案馆
阅读
查看源代码
查看历史
模块
讨论
更多操作
←
Module:Awajie
因为以下原因,您没有权限编辑该页面:
您所请求的操作,仅限具有
注册用户
、
自动确认用户
、
管理员
、
界面管理员
、
优质编辑者
、
确认用户
、
巡查员
、
档案理事员
等
权限
的
用户
执行。
若您尚未登录有兽档案馆账号,请您
登录
有兽档案馆账号后操作。
您尚未完成电子邮件确认,因此操作受限,请尽快
完成电子邮件确认
。
若您无法完成前述手续,请通过适当渠道请求管理员或档案理事员协助。
您可以查看和复制此页面的源代码。
若您无权编辑本页面,您可以
提出编辑请求
,提请有权限者代为编辑。
local p = {} function p.test(frame) local args = frame.args local order = args[1] local name = args[2] local some = args[3] local function contains(t, value) for _, v in ipairs(t) do if v == value then return true end end return false end local function custom_sort(a, b) return tonumber(a) > tonumber(b) end if name == nil or name == "" then return "文本为空,请在|name=填入要查询的角色名" end local pattern = "第(%d+)话" local extracted_numbers = {} for match in (some..pattern):gmatch(pattern) do if not contains(extracted_numbers, match) then table.insert(extracted_numbers, match) end end local sorted_t = {} for i, x in ipairs(extracted_numbers) do table.insert(sorted_t, tonumber(x)) end if order == 'asc' then table.sort(sorted_t) elseif order == 'desc' then table.sort(sorted_t, custom_sort) end local huashu = {} for i, num in ipairs(sorted_t) do local new_value = "[[第" .. num .. "话]]" table.insert(huashu, new_value) end local plainlinks = "plainlinks" local namelur = "<span class=" ..plainlinks.. ">[https://youshou.wiki/wiki/Special:%E8%AF%A2%E9%97%AE/-5B-5BOnCamera:character-20name::" ..name.. "-5D-5D/limit%3D50/format%3Dplainlist 查询更多]</span>" table.insert(huashu, namelur) local result = {} local counter = 0 for _, val in ipairs(huashu) do table.insert(result, val) counter = counter + 1 if counter % 14 == 0 and counter ~= #huashu then table.insert(result, "<br>") end if counter % 14 ~= 0 then table.insert(result, " · ") end end local lastElement = table.remove(result) if lastElement ~= " · " then table.insert(result, lastElement) end local output = table.concat(result, "") return output end function p.listl( framel ) local orderl = framel.args[1] -- local w = "[[OnCamera:character name::"..orderl.."]]" -- local queryResult = mw.smw.ask( w ) -- if queryResult == nil then -- return "404" -- end -- local a = {} -- for i, x in ipairs(queryResult) do -- for _, i in ipairs(x) do -- table.insert(a, i) -- end -- end -- local output = table.concat(a, "") -- return output local function smwask(name,zuc,table_1) zuc = zuc or nil if zuc == "主要" then askkind = "[[OnCamera:type::主要]]" elseif zuc == "次要" then askkind = "[[OnCamera:type::次要]]" elseif zuc == "背景" then askkind = "[[OnCamera:type::背景]]" else askkind = "" end local nameu = "[[OnCamera:character name::"..name.."]]"..askkind.."|?OnCamera:number=|mainlabel=-|sort=OnCamera:number|limit=1000|format=count" local jieg = mw.smw.ask( name ) for i, x in ipairs(jieg) do for _, i in ipairs(x) do table.insert(table_1, i) end end end local aa ={} local output = smwask(orderl,"",aa) local outpu = table.concat(aa, "") return outpu end return p
该页面使用的模板:
Module:Arguments
(
查看源代码
)
Module:Awajie
(
查看源代码
)
Module:Awajie/doc
(
查看源代码
)
Module:Documentation
(
查看源代码
)
Module:Featured picture list/dates
(
查看源代码
)
Module:Featured picture list/randoms
(
查看源代码
)(受半保护)
Module:Fullurl
(
查看源代码
)
Module:No globals
(
查看源代码
)
Module:Page name
(
查看源代码
)
Module:Yesno
(
查看源代码
)
返回
Module:Awajie
。