Skip to content

Commit

Permalink
SQUASH: 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 8ddbe85 commit 531e54e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mud/pkuxkx/plugins/basic/char/score.tin
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ event.Define {char/saving} {无参} {$MODULE} {银行存款数据更新};
#var char[档案][低级任务] {-1};
#var char[档案][劫匪掉宝] {-1};

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

#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)}}}};
Expand Down
2 changes: 1 addition & 1 deletion mud/pkuxkx/plugins/basic/cmds/jobquery.tin
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ VAR {任务CD状态查询结果} gJobState {};

#class jobquery-parser open;

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

#nop 这里一共有 7 个占位符;
#local jobHeader {│[%d]%!s│[{门|新|主|特}]%!s│%S{|\((\d+)\)} {|([0-9.]+)%}%!s};
Expand Down
23 changes: 20 additions & 3 deletions mud/pkuxkx/plugins/basic/cmds/link.tin
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,37 @@ PaoTin++ © 2020~2023 的所有版权均由担子炮(dzp <[email protected]>)
*/

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

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

#local link {};
#local time {@math.Eval{@time.Now{} + $cd}};
#foreach {$links} {link} {
#line sub var #sub {~\e[4m$link} {@mslp.Send{{$cmd $link};$link}};
#line sub var #sub {~\e[4m$link} {@mslp.Exec{{link.delayExec $time {$cmd $link}};$link}};
};
};

#alias {link.delayExec} {
#local time {%1};
#local cmd {%2};

#local now {@time.Now{}};
#if { $now > $time } {
$cmd;
};
#else {
#local delay {@math.Eval{$time - $now + 1}};
warnLog 服务器 CD 中,稍候片刻,即将执行。;
#line sub var #delay $delay {$cmd};
};
};

0 comments on commit 531e54e

Please sign in to comment.