北大侠客行MUD论坛

 找回密码
 注册
搜索
热搜: 新手 wiki 升级
查看: 3737|回复: 7

[长安男爵]羞涩的分享一个半成品

[复制链接]
发表于 2020-10-5 01:18:15 | 显示全部楼层 |阅读模式
本帖最后由 zleo 于 2020-10-10 03:04 PM 编辑

刚刚小胡冲(bhbha)看我男爵做得快,跟我要我的男爵机器人。

其实我只写了一个很烂的辅助数据采集代码

最近做男爵的人比较多,不好藏私,分享一下我的半成品,希望更有能力的新道友们能在此基础上写出更完善的男爵机器。

目标软件:ZMud 7.21


  1. #CLASS {男爵指认}
  2. #ALIAS nj {ask shaoyin about 领赏;ask shaoyin about 任务信息;ask shaoyin about 积分}
  3. #ALIAS ww {ask luren 1 about 消息;ask luren 2 about 消息;ask luren 3 about 消息;ask luren 4 about 消息;ask luren 5 about 消息}
  4. #ALIAS ss {l luren 1;#wa 500;l luren 2;#wa 500;l luren 3;#wa 500;l luren 4}
  5. #REGEX 这是一位(.*)的行人. {#if (%1=矮小灵活) {luren=@luren 高矮1 胖瘦1};#if (%1=娇小玲珑) {luren=@luren 高矮1 胖瘦1};#if (%1=矮小粗胖) {luren=@luren 高矮1 胖瘦2};#if (%1=身材丰满矮小) {luren=@luren 高矮1 胖瘦2};#if (%1=宛如一根竹竿) {luren=@luren 高矮2 胖瘦1};#if (%1=丰胸细腰,身材苗条挺拔) {luren=@luren 高矮2 胖瘦1};#if (%1=高大魁梧) {luren=@luren 高矮2 胖瘦2};#if (%1=身材异常魁梧高大) {luren=@luren 高矮2 胖瘦2}}
  6. #VAR luren {年龄2 性别1 高矮2 胖瘦1 鞋1|2 衣服2|1}
  7. #REGEX {1_(\d+)\s\s缉拿罪犯「(\S+)」\s+新建\s+\d+:\d+:\d+\s+\d+:\d+:\d+\s+(\S+)\s无\s+0} {#show %1 %2 %3 %4//record 1_%1}
  8. #REGEX {最近长安城内出现不少盗窃事件,有人报告(\S+)附近商铺} {#show %1;obj_reset}
  9. #REGEX {你向(\S+)问道:这位(\S+),不知最近有没有听说什么消息?\n\S+说道:「(\S+)」} {#show %1 %2 %3;#if (%pos( 竹竿, %3)) {weight=1};#if (%pos( 猴子, %3)) {weight=1};#if (%pos( 瘦, %3)) {weight=1};#if (%pos( 廋, %3)) {weight=1};#if (%pos( 胖, %3)) {weight=2};#if (%pos( 发福, %3)) {weight=2};#if (%pos( 女, %3)) {sex=2};#if (%pos( 流浪汉, %3)) {sex=1};#if (%pos( 男, %3)) {sex=1};#if (%pos( 高个子, %3)) {high=2};#if (%pos( 矮个子, %3)) {high=1};#if (%pos( 不高, %3)) {high=1};#if (%pos( 不太高, %3)) {high=1};#if (%pos( 年轻人, %3)) {age=1};#if (%pos( 非常年轻, %3)) {age=1};#if (%pos( 青年, %3)) {age=1};#if (%pos( 中年, %3)) {age=2};#if (%pos( 老大不小, %3)) {age=2};#if (%pos( 半只脚埋入棺材, %3)) {age=3};#if (%pos( 白发苍苍, %3)) {age=3};#if (%pos( 花白, %3)) {age=3};#if (%pos( 凉鞋, %3)) {boot_type=1};#if (%pos( 布鞋, %3)) {boot_type=2};#if (%pos( 靴子, %3)) {boot_type=3};#if (%pos( 布衣, %3)) {cloth_type=1};#if (%pos( 夹袄, %3)) {cloth_type=2};#if (%pos( 丝绸衣服, %3)) {cloth_type=3};#if (%pos( 浅, %3) & %pos( 鞋, %3)) {boot_color=1};#if (%pos( 深, %3) & %pos( 鞋, %3)) {boot_color=2};#if (%pos( 浅, %3) & %pos( 衣, %3)) {cloth_color=1};#if (%pos( 深, %3) & %pos( 衣, %3)) {cloth_color=2};#show 年龄@age 性别@sex 高矮@high 胖瘦@weight 衣服@cloth_color|@cloth_type 鞋@boot_color|@boot_type}
  10. #REGEX {(.*)看起来约(.*)十多岁} {lr_reset;#if (%2=二 or %2=三) {luren=年龄1;age_lr=1};#if (%2=四 or %2=五) {luren=年龄2;age_lr=2};#if (%2=六 or %2=七) {luren=年龄3;age_lr=3};#if (%pos( 他, %1)) {luren=@luren 性别1;sex_lr=1} {luren=@luren 性别2;sex_lr=2}}
  11. #REGEX {□身穿一件蝙蝠血甲\(Bianfuxue} {#ga;say kk}
  12. #REGEX {这是一(.*)的行人} {#if (%pos( 矮小灵活, %1) or %pos( 娇小玲珑, %1)) {luren=@luren 高矮1 胖瘦1;high_lr=1;weight_lr=1};#if (%pos( 矮小粗胖, %1) or %pos( 身材丰满矮小, %1)) {luren=@luren 高矮1 胖瘦2;high_lr=1;weight_lr=2};#if (%pos( 宛如一根竹竿, %1) or %pos( 丰胸细腰,身材苗条挺拔, %1)) {luren=@luren 高矮2 胖瘦1;high_lr=2;weight_lr=1};#if (%pos( 高大魁梧, %1) or %pos( 身材异常魁梧高大, %1)) {luren=@luren 高矮2 胖瘦2;high_lr=2;weight_lr=2}}
  13. #TRIGGER {%e[0m脚穿一双%e[(%d);(%d)m(%x)%e[0m} {#if (%2=30 or %2=31 or %2=34 or %2=35) {boot_color_lr=2};#if (%2=32 or %2=33 or %2=3 or %2=37) {boot_color_lr=1};#if (%3="木屐" or %3="草鞋" or %3="破鞋") {luren=@luren 鞋@boot_color_lr|1;boot_type_lr=1};#if (%3="绣花鞋" or %3="锦鞋" or %3="凤鞋" or %3="布鞋" or %3="麻鞋" or %3="千层底布鞋") {luren=@luren 鞋@boot_color_lr|2;boot_type_lr=2};#if (%3="牛皮短靴" or %3="马靴" or %3="女式短靴" or %3="女式长靴" or %3="薄底快靴" or %3="七星剑靴") {luren=@luren 鞋@boot_color_lr|3;boot_type_lr=3}} "" {color}
  14. #TRIGGER {%e[0m脚穿一双%e[(%d)m(%x)%e[0m} {#if (%1=30 or %1=31 or %1=34 or %1=35) {boot_color_lr=2};#if (%1=32 or %1=33 or %1=36 or %1=37) {boot_color_lr=1};#if (%2="木屐" or %2="草鞋" or %2="破鞋") {luren=@luren 鞋@boot_color_lr|1;boot_type_lr=1};#if (%2="绣花鞋" or %2="锦鞋" or %2="凤鞋" or %2="布鞋" or %2="麻鞋" or %2="千层底布鞋") {luren=@luren 鞋@boot_color_lr|2;boot_type_lr=2};#if (%2="牛皮短靴" or %2="马靴" or %2="女式短靴" or %2="女式长靴" or %2="薄底快靴" or %2="七星剑靴") {luren=@luren 鞋@boot_color_lr|3;boot_type_lr=3}} "" {color}
  15. #TRIGGER {你说道:「kk」} {xs;#show 年龄@age_lr 性别@sex_lr 高矮@high_lr 胖瘦@weight_lr 鞋@boot_color_lr|@boot_type_lr 衣服@cloth_color_lr|@cloth_type_lr}
  16. #TRIGGER {%e[0m身穿一件%e[(%d);(%d)m(%x)%e[0m} {#if (%2=30 or %2=31 or %2=34 or %2=35) {cloth_color_lr=2};#if (%2=32 or %2=33 or %2=3 or %2=37) {cloth_color_lr=1};#if (%3="坎肩" or %3="圆领衫" or %3="灰布衫" or %3="灰马褂" or %3="百褶裙" or %3="蓝马褂" or %3="短打劲装" or %3="天蓝锦袍") {luren=@luren 衣服@cloth_color_lr|1;cloth_type_lr=1};#if (%3="鹤氅" or %3="长袄" or %3="棉袄" or %3="狼皮袄" or %3="短袄" or %3="比甲") {luren=@luren 衣服@cloth_color_lr|2;cloth_type_lr=2};#if (%3="丝织长衫" or %3="丝绸短襦" or %3="绸袍" or %3="丝织儒衫" or %3="轻罗纱" or %3="旗袍") {luren=@luren 衣服@cloth_color_lr|3;cloth_type_lr=3}} "" {color}
  17. #TRIGGER {%e[0m身穿一件%e[(%d)m(%x)%e[0m} {#if (%1=30 or %1=31 or %1=34 or %1=35) {cloth_color_lr=2};#if (%1=32 or %1=33 or %1=36 or %1=37) {cloth_color_lr=1};#if (%2="坎肩" or %2="圆领衫" or %2="灰布衫" or %2="灰马褂" or %2="百褶裙" or %2="蓝马褂" or %2="短打劲装" or %2="天蓝锦袍") {luren=@luren 衣服@cloth_color_lr|1;cloth_type_lr=1};#if (%2="鹤氅" or %2="长袄" or %2="棉袄" or %2="狼皮袄" or %2="短袄" or %2="比甲") {luren=@luren 衣服@cloth_color_lr|2;cloth_type_lr=2};#if (%2="丝织长衫" or %2="丝绸短襦" or %2="绸袍" or %2="丝织儒衫" or %2="轻罗纱" or %2="旗袍") {luren=@luren 衣服@cloth_color_lr|3;cloth_type_lr=3}} "" {color}
  18. #TRIGGER {%e[0m身穿一件(%x)~(} {cloth_color_lr=1;#if (%1="坎肩" or %1="圆领衫" or %1="灰布衫" or %1="灰马褂" or %1="百褶裙" or %1="蓝马褂" or %1="短打劲装" or %1="天蓝锦袍") {luren=@luren 衣服@cloth_color_lr|1;cloth_type_lr=1};#if (%1="鹤氅" or %1="长袄" or %1="棉袄" or %1="狼皮袄" or %1="短袄" or %1="比甲") {luren=@luren 衣服@cloth_color_lr|2;cloth_type_lr=2};#if (%1="丝织长衫" or %1="丝绸短襦" or %1="绸袍" or %1="丝织儒衫" or %1="轻罗纱" or %1="旗袍") {luren=@luren 衣服@cloth_color_lr|3;cloth_type_lr=3}} "" {color}
  19. #TRIGGER {%e[0m脚穿一双(%x)~(} {boot_color_lr=1;#if (%1="木屐" or %1="草鞋" or %1="破鞋") {luren=@luren 鞋@boot_color_lr|1;boot_type_lr=1};#if (%1="绣花鞋" or %1="锦鞋" or %1="凤鞋" or %1="布鞋" or %1="麻鞋" or %1="千层底布鞋") {luren=@luren 鞋@boot_color_lr|2;boot_type_lr=2};#if (%1="牛皮短靴" or %1="马靴" or %1="女式短靴" or %1="女式长靴" or %1="薄底快靴" or %1="七星剑靴") {luren=@luren 鞋@boot_color_lr|3;boot_type_lr=3}} "" {color}
  20. #CLASS 0
  21. #CLASS {男爵指认|obj}
  22. #ALIAS obj_reset {age=0;boot_color=0;boot_type=0;cloth_color=0;cloth_type=0;high=0;sex=0;weight=0;gxy="";#show 年龄@age 性别@sex 高矮@high 胖瘦@weight 衣服@cloth_color|@cloth_type 鞋@boot_color|@boot_type}
  23. #ALIAS xs {#show 年龄@age 性别@sex 高矮@high 胖瘦@weight 鞋@boot_color|@boot_type 衣服@cloth_color|@cloth_type}
  24. #VAR age {2}
  25. #VAR sex {2}
  26. #VAR high {2}
  27. #VAR weight {0}
  28. #VAR cloth_type {0}
  29. #VAR cloth_color {0}
  30. #VAR boot_type {3}
  31. #VAR boot_color {0}
  32. #CLASS 0
  33. #CLASS {男爵指认|lr}
  34. #ALIAS lr_reset {age_lr=0;boot_color_lr=0;boot_type_lr=0;cloth_color_lr=0;cloth_type_lr=0;high_lr=0;sex_lr=0;weight_lr=0;lr_score=0;lr_score2=0}
  35. #VAR weight_lr {1}
  36. #VAR sex_lr {1}
  37. #VAR high_lr {2}
  38. #VAR cloth_type_lr {1}
  39. #VAR cloth_color_lr {2}
  40. #VAR boot_type_lr {2}
  41. #VAR boot_color_lr {1}
  42. #VAR age_lr {2}
  43. #CLASS 0
  44. #CLASS {男爵指认|other}
  45. #TRIGGER {和你的师门并无任何渊源。} {#ga -2} "" {disable}
  46. #TRIGGER {的武功看上去} {#ga} "" {disable}
  47. #TRIGGER {和你此前并未交手过。} {#ga} "" {disable}
  48. #TRIGGER {看起来气血充盈,并没有受伤。} {#ga -5;#ga}
  49. #TRIGGER {手持一} {#ga -1;#ga} "" {disable}
  50. #CLASS 0
复制代码
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
 楼主| 发表于 2020-10-5 01:52:48 | 显示全部楼层
补充一个男爵小技巧

长乐坊应该是个禁止战斗的房间,不仅pfm不能用,yun recover也不行,但是我已经遇到三次盗贼在这个房间了,这使得战斗充满风险。

我能想到的办法,是先yun qi,再去ask盗贼,起码可以多撑一会儿…………
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
发表于 2020-10-5 17:25:10 | 显示全部楼层
虽然看不懂,还是支持一下
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
发表于 2020-10-5 19:49:40 | 显示全部楼层
好复杂的样子,男爵任务一直没有搞懂,要看哪些npc?
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
发表于 2020-10-10 15:02:40 | 显示全部楼层
刚开始准备做做男爵任务,感谢!
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
 楼主| 发表于 2020-10-10 15:06:27 | 显示全部楼层
championa 发表于 2020-10-10 03:02 PM
刚开始准备做做男爵任务,感谢!

发现代码有误,修正了,你重新拷一下
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
发表于 2020-11-10 06:53:26 | 显示全部楼层
suwuji 发表于 2020-10-5 07:49 PM
好复杂的样子,男爵任务一直没有搞懂,要看哪些npc?

应该是 luren 1~8,会出现在指定房间的周围。
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
发表于 2023-11-9 12:16:48 | 显示全部楼层
最后怎么判断谁是盗贼啊?恕我愚笨,请教一下
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|北大侠客行MUD ( 京ICP备16065414号-1 )

GMT+8, 2024-4-26 12:21 PM , Processed in 0.009591 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表