匿名
未登录
中文(中国大陆)
登录
Limbo Wiki
搜索
查看“模块:Terminal”的源代码
来自Limbo Wiki
命名空间
模块
讨论
更多
更多
页面操作
阅读
查看源代码
历史
←
模块:Terminal
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local out = require("Module:Out") local p = {} function p.run(frame) args = frame:getParent().args prompt = frame.args["prompt"] color = frame.args["color"] result = frame.args["result"] for i, cmd in ipairs(args) do if mw.ustring.sub(cmd, 1, 1) == "/" then -- 命令输入 out.writeln(prompt .. out.color(mw.ustring.sub(cmd, 2), color)) elseif mw.ustring.sub(cmd, 1, 1) == "@" then -- 控制命令 默认只有一个参数 忽略空格 cut = mw.ustring.find(cmd, " ", 1, true) name = mw.ustring.sub(cmd, 2, cut - 1) arg = mw.ustring.sub(cmd, cut + 1) if name == "color" then color = arg elseif name == "result" then result = arg elseif name == "prompt" then prompt = arg end else -- 命令回显 out.writeln(out.color(cmd, result)) end end end p.main = out.create_main(p.run) return p
调试控制台
* 此模块的返回的值存于控制台变量“p”中,包括没有保存的变更。 * 在一行的前面加上“=”可以将其作为表达式来计算或使用print()显示。显示表格请使用mw.logObject()。 * 在模块代码中使用mw.log()和mw.logObject()来向控制台发送消息。
本页使用的模板:
模板:Default
(
查看源代码
)
模板:欢迎编辑
(
查看源代码
)
模块:Terminal/doc
(
查看源代码
)
返回
模块:Terminal
。
导航
导航
首页
最近更改
随机页面
操作申请
帮助
入门指南
编辑指南
写作指南
随机
官方
碎数研
谜题保管所
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志