SetOnTimer » 历史记录 » 修订 4
修订 3 (yangdefeng, 2023-07-26 09:44) → 修订 4/5 (yangdefeng, 2023-07-26 09:45)
h4. _*%{color:green}setOnTimer%*_
设置一个定时器,
按设定的时间间隔,执行[[qmanage|登录设置脚本]]中的对应定时器触发块
登录设置脚本文件路径
..\Mir200\Envir\MapQuest_Def\QManage.txt
标签:命令定义|setOnTimer
*格式*
|_.命令名 |_.参数1 |_.参数2 |
|setOnTimer|定时器编号|定时间隔(秒) |
*说明*
* 参数1
自定义定时器的编号[0,2^64-1]
* 参数2
定时间隔设置
几秒中触发一次
* 执行setOnTimer命令时,QManage.txt中对应定时触发器会执行一次
即,
设定了一个每小时执行一次的定时器,
设定完毕,会执行一次
1小时后,会执行第二次
-
-
h4. *%{color:deepskyblue}特戒引擎脚本示例:%*
bq. %{color:lightGrey};执行脚本设置定时器%
[@main]
#say
<开启定时/<notextile>@</notextile>开启定时>\ \
<关闭定时/<notextile>@</notextile>关闭定时>
%{color:lightGrey};--执行开启定时器%
[<notextile>@</notextile>开启定时]
#act
*{color:green}setOnTimer* 0 5
*{color:green}setOnTimer* 1 10
[[sendMsg]] 6 254 0号,1号定时器已开启
%{color:lightGrey};--执行关闭定时器%
[<notextile>@</notextile>关闭定时]
#act
[[setOffTimer]] 0
[[setOffTimer]] 1
[[sendMsg]] 6 254 0号,1号定时器已关闭
bq. %{color:fireBrick};编辑登录设置脚本 %{color:lightGrey};编辑登录设置脚本
;..\Mir200\Envir\MapQuest_Def\QManage.txt%
%{color:lightGrey};定时器0%
[@onTimer0]
#act
[[sendMsg]] 6 <$time>位于%m|<$x>,<$y>
%{color:lightGrey};定时器1%
[@onTimer1]
#act
[[sendMsg]] 6 【特戒通知】过了10秒