Lua接口/服务端/PrintStr:修订间差异
来自天龙知识库
跳到导航跳到搜索
整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示2个用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
__NOTOC__ | __NOTOC__ | ||
<div class="lua-reference | <div class="lua-reference"> | ||
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/通用与活动|通用与活动]] · [[Lua接口/服务端调用约定|调用约定]] | [[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/通用与活动|通用与活动]] · [[Lua接口/服务端调用约定|调用约定]] | ||
<div | <div class="lua-lead lua-rule">弹出消息框,测试脚本用</div> | ||
== Lua 调用 == | == Lua 调用 == | ||
<pre | <pre>PrintStr(strText)</pre> | ||
服务端脚本中共出现 17 处调用,实参个数出现过:1 个(17 处)。 | |||
实现位于 <code>LuaFnTbl_Misc.h</code>。 | |||
== 参数 == | == 参数 == | ||
{| class="wikitable | {| class="wikitable" | ||
! scope="col" | ! scope="col" class="lua-w11" | 序号 | ||
! scope="col" | ! scope="col" class="lua-w36" | 参数 / 类型 | ||
! scope="col | ! scope="col" | 说明 | ||
|- | |- | ||
| 1 | |||
| <code>strText</code><br /><span class="lua-muted"><code>string</code></span> | |||
| | | 消息框的提示字符串<br /><span class="lua-muted">脚本中的实参:<code>strText</code>(11 处)、<code>"dd"</code>、<code>"dfgh"</code></span> | ||
|} | |} | ||
| 第22行: | 第26行: | ||
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | 无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | ||
< | == 脚本中的调用 == | ||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 7 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | |||
<pre>-- event/chuansong/echuansong_dawan_samaerhan.lua | |||
PrintStr("dd") | |||
-- event/festival/SpringFestival07/ShiMen_CaiJi.lua | |||
PrintStr(strText) | |||
-- event/huodong/eShuangyingBoss.lua | |||
PrintStr("Have a Monster in the scene") | |||
-- event/huodong/eShuangyingBoss.lua | |||
PrintStr("There is no Monster in the scene") | |||
-- event/sceneevent/shilin_940.lua | |||
PrintStr("找不到 杨铁信") | |||
-- event/test/etest_0006.lua | |||
PrintStr("背包空间不够") | |||
-- obj/item/guanpiao.lua | |||
PrintStr("dfgh")</pre> | |||
</div> | </div> | ||
2026年9月20日 (日) 00:12的最新版本
弹出消息框,测试脚本用
Lua 调用
PrintStr(strText)
服务端脚本中共出现 17 处调用,实参个数出现过:1 个(17 处)。
实现位于 LuaFnTbl_Misc.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | strTextstring
|
消息框的提示字符串 脚本中的实参: strText(11 处)、"dd"、"dfgh"
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 7 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/chuansong/echuansong_dawan_samaerhan.lua
PrintStr("dd")
-- event/festival/SpringFestival07/ShiMen_CaiJi.lua
PrintStr(strText)
-- event/huodong/eShuangyingBoss.lua
PrintStr("Have a Monster in the scene")
-- event/huodong/eShuangyingBoss.lua
PrintStr("There is no Monster in the scene")
-- event/sceneevent/shilin_940.lua
PrintStr("找不到 杨铁信")
-- event/test/etest_0006.lua
PrintStr("背包空间不够")
-- obj/item/guanpiao.lua
PrintStr("dfgh")