Skip to content

Commit

Permalink
SQUASH: feat(pkuxkx): 增加 set 环境变量和 buff 周相关触发
Browse files Browse the repository at this point in the history
抓取重启时间
  • Loading branch information
dzpao committed May 5, 2024
1 parent 347ef11 commit 885e931
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
23 changes: 21 additions & 2 deletions mud/pkuxkx/plugins/basic/env.tin
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ PaoTin++ © 2020~2024 的所有版权均由担子炮(dzp <danzipao@gmail.com>)
{NOTE} {本文件属于 PaoTin++ 的一部分}
};

VAR {服务器环境变量} {env.Var} {};
VAR {当前游戏周} {env.Week} {};
VAR {服务器环境变量} {env.Var} {};
VAR {当前游戏周} {env.Week} {};
VAR {服务器重启时间} {env.RebootTime} {0};

event.Define {env/set} {无参} {$MODULE} {环境变量发生改变(set/unset)时发送本事件,本事件只会唤醒与变量名相匹配的钩子};
event.Define {env/update} {无参} {$MODULE} {环境变量列表已更新};
Expand Down Expand Up @@ -155,6 +156,13 @@ event.Define {env/time/update} {无参} {$MODULE} {当前游戏周的内容已
env.parse;
};


#action {^北大侠客行再过%*将重新启动 ...$} {
#local time {@time.ParseDoC{%1}};
#var env.RebootTime {@time.Now{} + $time};
prompt.Set {{reboot}{$time}};
};

/*
╭───玄武之周┬──────────────────────────────────╮
│ 仆人 │玄武职业防御提升。 │
Expand Down Expand Up @@ -191,6 +199,17 @@ event.Define {env/time/update} {无参} {$MODULE} {当前游戏周的内容已
};
};

#action {^│%*│北京时间%d年%d月%d日%s%d时%d分%d秒,将于%d月%d日%s%d时%d分重启。%s│$} {
#nop 简单处理一下,假设重启预报不会超过 24 小时。;
#local reboot {@math.Eval{(%%12 - %%6) * 3600 + (%%13 - %%7) * 60 + 60 - %%8}};
#if { %%10 > %%4 } {
#local reboot {@math.Eval{(23 - %%6) * 3600 + (59 - %%7) * 60 + 60 - %%8}};
#local reboot {@math.Eval{$reboot + %%12 * 3600 + %%13 * 60}};
};
#local env.RebootTime {@time.Now{} + $reboot};
prompt.Set {{reboot}{$reboot}};
};

event.HandleOnce GA {basic/env} {basic/env} {
event.Emit env/time/update;
okLog 当前游戏周已更新。;
Expand Down
8 changes: 0 additions & 8 deletions mud/pkuxkx/plugins/shortcut.tin
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,6 @@ load-lib sync;

#subst {~\e[34m} {\e[94m};

VAR 服务器重启时间 gServerRebootTime {0};

#action {^北大侠客行再过%*将重新启动 ...$} {
#local time {@time.ParseDoC{%1}};
#var gServerRebootTime {@time.Now{} + $time};
prompt.Set {{reboot}{$time}};
};

#alias {list-armors} {
#class rbz-list-armors open;

Expand Down

0 comments on commit 885e931

Please sign in to comment.