Skip to content

Commit

Permalink
feat(pkuxkx): 激活 score/jobquery 等命令中的超链接
Browse files Browse the repository at this point in the history
  • Loading branch information
dzpao committed Jul 23, 2024
1 parent 333d039 commit 8ddbe85
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mud/pkuxkx/plugins/basic/char/score.tin
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PaoTin++ © 2020~2023 的所有版权均由担子炮(dzp <danzipao@gmail.com>)
};

load-module {basic/title};
load-module {basic/cmds/link};
load-lib event;

event.Define {char/score} {无参} {$MODULE} {score 命令的数据解析成功时,发送本事件};
Expand Down Expand Up @@ -77,6 +78,8 @@ event.Define {char/saving} {无参} {$MODULE} {银行存款数据更新};
#var char[档案][低级任务] {-1};
#var char[档案][劫匪掉宝] {-1};

link.Enable score {年龄;存款;死亡};

#line oneshot #action {~^%c│%c %* %c%+1..S%c(%+3..S)%c%s%c│%*│%c$} {
#local obj {@ParseTitle{@str.Trim{@str.Plain{%%3 %%5(%%7)}}}};
#var char[档案][头衔] {$obj[title]};
Expand Down
4 changes: 4 additions & 0 deletions mud/pkuxkx/plugins/basic/cmds/jobquery.tin
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ PaoTin++ © 2020~2023 的所有版权均由担子炮(dzp <danzipao@gmail.com>)

event.Define {jobquery} {无参} {$MODULE} {任务CD状态查询结果已更新,内容在变量 gJobState 中};

load-module basic/cmds/link;

/*
jobquery 本来就有两个别名:
1. jobquery 长一些,不方便输入,用的较少,因此重定义其行为,默认屏蔽系统输出
Expand Down Expand Up @@ -159,6 +161,8 @@ VAR {任务CD状态查询结果} gJobState {};

#class jobquery-parser open;

link.Enable jobquery {藏经阁;大唐爵位任务};

#nop 这里一共有 7 个占位符;
#local jobHeader {│[%d]%!s│[{门|新|主|特}]%!s│%S{|\((\d+)\)} {|([0-9.]+)%}%!s};
#local jobEnd {%!s│};
Expand Down
26 changes: 26 additions & 0 deletions mud/pkuxkx/plugins/basic/cmds/link.tin
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#nop vim: set filetype=tt:;

/*
本文件属于 PaoTin++ 的一部分。
PaoTin++ © 2020~2023 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 享有并保留一切法律权利
你可以在遵照 GPLv3 协议的基础之上使用、修改及重新分发本程序。
*/

///=== {
// ## link.Enable <命令名称> <链接名称>
// 为指定的命令激活其中的超链接。如果有多个链接,可以用字符串列表来表达。
// };
#alias {link.Enable} {
#local cmd {%1};
#local links {%2};

#if { "$cmd" == "" || "$links" == "" } {
xtt.Usage %90;
#return;
};

#local link {};
#foreach {$links} {link} {
#line sub var #sub {~\e[4m$link} {@mslp.Send{{$cmd $link};$link}};
};
};

0 comments on commit 8ddbe85

Please sign in to comment.