hepat 发表于 2014-10-5 10:47:47

怎么搞得 群里像啥机器人都有的样子
我怎么都找不到
就找到一点点 不太好的照片呢!!!

niwawa 发表于 2014-10-5 17:26:56

有好机器小小师姐要普惠全武林同道后进之辈,怎能囿于门户之见只在贵门内分享呢?{:7_279:}

oolong 发表于 2014-10-6 01:19:11

本帖最后由 oolong 于 2014-10-6 02:07 AM 编辑

回复 6# yunlan
zmud 462有点麻烦,zmud721就简单了直接正则了事,可以用#addkey存到record变量中。

zmud462的一个解决办法。供参考。
^第(*)列。
#case %eval(%numwords(%1,"个字在第")-1)
{#echo 1 %word(%word(%1,1,"行第"),2,"在第") %word(%word(%1,1,"列"),2,"行第")} {#echo 1 %word(%word(%1,1,"行第"),2,"在第") %word(%word(%1,1,"列"),2,"行第") 2 %word(%word(%1,2,"行第"),2,"在第") %word(%word(%1,2,"列"),2,"行第") }
{} {} {} {}

仅仅列举case 1,case 2,3,4...多少个字自己写吧
注:
第几个字:%eval(%numwords(%1,"个字在第")-1)
第几行:%word(%word(%1,@nnnnnnnnn,"行第"),2,"在第")
第几列:%word(%word(%1,@nnnnnnnnn,"列"),2,"行第")
@nnnnnnnnn就是第几个字的意思。。。
#case 就是选择你要怎么弄啊,两个字肯定执行第二个括号的命令。
你可以用其他的trigger,#echo只是演示一下。。。

-----------------------------------------------------------------------------------------------------------------------------------
感觉事件做了一半{:7_274:} ,最好转换一下中文和数值。
#FUNC trans {%eval(%replace(%replace(%concat("(0+"%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%1,"零","*0+"),"十","*10+"),"百","*100+"),"千","*1000+"),"万","+0)*10000+(0+"),"亿","+0)*100000000+(0+"),"六","6"),"一","1"),"二","2"),"三","3"),"四","4"),"五","5"),"七","7"),"八","8"),"九","9")"+0)"),"++","+"),"+*","+"))}

先定义一个函数@trans,那么@trans(十二)就可以转换成12了。

所以上面的触发可以这样写:

^第(*)列。
#case %eval(%numwords(%1,"个字在第")-1)
{#echo 1 @trans(%word(%word(%1,1,"行第"),2,"在第")) @trans(%word(%word(%1,1,"列"),2,"行第"))}
{} {} {} {} {}

应该可以了,照例 case 2,3,4....n自己写

imtt 发表于 2014-10-7 06:57:03

*thank all
*admire
页: 1 [2]
查看完整版本: 请教抓取一个或两个汉字的触发应该怎么写