有人会用zmud的mapper么?
zmud 462的automapper可以用通配符配置,虽然不太直观但是够灵活。但是462的automapper不能解su、ed之类方向的问题,而且无法导出数据,所以没什么用处。今天稍微试了试zmud 721的automapper,发现721抓取roomname什么的竟然是通过指定第几行第几段来实现,反而不会用了。有没有知道咋才能在721里实现像462那样的配置?
thanks~ 一会我研究一下看看。 又折腾了半天,搞不懂,像462那样多好。。。 TAG
Syntax: #TAG line-kind
Allows you to override the normal operation of the automapper.This powerful command allows you to tell the mapper what kind of line it has received and specify optional parameters for that line type.The line-kind argument is the type of line the MUD just sent.It can contain one or more of the following values, separated by commas (no spaces):
name the name of the room
desc the room description
exit the room exit information
vnum the virtual room number
flags flag settings for the room
prompt the MUD prompt
descpara the entire paragraph is the room description
exitpara the entire paragraph is the exit information
When tagging a line, the mapper will normally use the entire line for the value of the tag.For example, if you tag a line as a Name, the entire line will be used as the room name.You can override this by specifying the room name as the optional parameter of the tag command.Each line-type can take a parameter.Parameters should be given in the same order that the line-kind values are given.Normally, these parameters are not evaluated or expanded since they represent literal text from the MUD.However, if an argument is a single variable reference, then the variable will be expanded.
Note that after setting up triggers using the TAG command, you should then Reconfigure the mapper so that it sets itself up properly.
TAG example
#TAG Name
Tags the current line as the name of the room
#TRIGGER {~[(*)~]} {#TAG name %1}
Sets up a trigger to look for the pattern: .This line is flagged as a room name, and the text within the brackets is sent to the mapper as the actual name of the room
#TRIGGER {^~>} {#TAG prompt}
Tags a line starting with a > as the MUD prompt
#TRIGGER {(*) ~[(*)~] ~#(%d)} {#TAG name,exit,vnum {%1} {%2} {%3}}
This complex trigger looks for a line of the format:
Room Name #num
and captures the room name, exit information, and vnum information for the mapper.
#TRIGGER {^#(%d)} {#VAR RoomName %concat("Room ",%1);#TAG name {@RoomName}}
This will look for a line that starts with "#nnn" where nnn is a room number (like #123).The number is captured and appended to "Room " and stored into the variable called RoomName.So, if the line from the MUD was #123, then @RoomName will be "Room 123".The #TAG command uses the value of @RoomName to set the room name.Since the argument for #TAG is a single variable reference, it is expanded properly. hiahia 这个命令俺也找着了,不过还是很麻烦,继续试吧。。 有这个已经可以保证生成正确的ROOM NAME信息了。描述和出口我有个大概的思路,一会再试试。- #VAR vdesc "";
#TRIGGER "EffCap" {(*)} {#additem vdesc "%1"} "" {disable};
#TRIGGER {^(*) -} {#tag name %1;#var vdesc "";#t+ EffCap};
#COND {^%s这里*出口是(*)} {#t- EffCap;#tag exit "%1";#tag desc @vdesc};这个已经差不多可以用了,不过还是有不完善的地方。
additem那一句抓不到空白行,像梅庄、少林、岳王墓一类的地方,有可能会出问题。
zmud的string list是用|当分隔符,简单replace成\n不知道好不好使,没找到zmud有像join那样的函数。
抓下来的描述信息里包括了出口和天色,出口是应该删掉的,天色因为可以用来判断室内室外,或许留个标记比较好。 BTW,462的mapper画出来会自动调整房间位置,防止覆盖,721反而不行了,也是个麻烦。。 刚刚测试完,ZMUD下的regexp支持多行触发
页:
[1]
2