talknpc的参数介绍
[quote]
# ai_talkNPC(x, y, sequence)
# x, y: the position of the NPC to talk to.
# sequence: A string containing the NPC talk sequences.
#
# Talks to an NPC. You can specify an NPC position, or an NPC ID.
#
# $sequence is a list of whitespace-separated commands:
# ~l
# c : Continue
# r# : Select option # from menu.
# n : Stop talking to NPC.
# b : Send the "Show shop item list" (Buy) packet.
# w# : Wait # seconds.
# x : Initialize conversation with NPC. Useful to perform multiple transaction with a single NPC.
# t="str" : send the text str to NPC, double quote is needed only if the string contains space
# ~l~
#
# Example:
# # Sends "Continue", "Select option 0" to the NPC at (102, 300)
# ai_talkNPC(102, 300, "c r0");
[/quote]
这段是在OK官方论坛上看到的,以往一直以为talknpc只有c/r/n三个参数而已.
大概的翻译下其他几个的介绍(我还没有试过,只能靠字面理解,E文不好别见怪XD)
b :显示商店商品清单
w# : 等待 # 秒钟
x : 初始化和NPC的对话,用于需要多次和同一个NPC对话的场合.
t="str" :发送 类似于 talktext,既把"str"发送给NPC.双引号只有当要发送的字符串用空格分开的时候才需要.
talknpc是指直接的和某个坐标的NPC对话,OK会自动在该点上找NPC,然后根据你输入的“C”也就是过程对话。实现的原理和运行挂机脚本时OK 和其他NPC对话的情况一样的(这点我也是在研究叠加NPC的时候发现的),所以说talknpc是OK最为“原版”的和NPC对话的方式。
talk @npc xxx yyy其实是OK里面talk #命令和MACRO里面@npc xxx yyy的结合。@npc xxx yyy的作用是返回该坐标点NPC的序号ID。talk #这个命令的运行方式是直接让OK访问该序号的NPC,所以比talknpc快,不用计算不用循环。但是,因为序号ID是和所在视野内的NPC数量以及先后次序有关的,所以在网络卡的时候,有可能返回的@npc xxx yyy的数值是错误的,所以,在一些复杂脚本里面,如果环境比较凌乱,NPC比较多,那么推荐用talknpc说话。
温馨提示:答案为网友推荐,仅供参考