During using timer of muchclient, I found a problem, for example, I set a timer which will be ran at 12:00:00, now the local computer time is 11:30:00, the original remaining time of the timer is 30m, but when the same timer is changed to be ran at 13:00:00 by a trigger, the remaing tiem is now 23h, the timer will not be ran after one and half hour.
timer bug
Posted by Lxhd on Fri 13 Feb 2015 04:14 AM — 6 posts, 23,920 views.
Can you show the timer, and the trigger please?
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
Please find below my trigger,timer,and script. Sorry, some content in the trigger is in Chinese, hope you could understand my intension.
_______________________________________________
<timer name="takedouble" enabled="y" hour="11" second="0.00" offset_second="0.00" send_to="12"
at_time="y" group="takedouble" >
<send>g_go_take_double=true;</send>
</timer>
__________________________________________________________
<trigger
group="takedouble"
lines_to_match="3"
match="^( |>)*你向李战打听有关『jobreward』的消息。\n\n^玩家可24小时领取一次任务额外奖励,持续时间6小时!!你(.+)个小时前领过!!$"
multi_line="y"
name="double_not_get"
regexp="y"
script="TakeDouble"
send_to="12"
sequence="100"
>
——————————————————————————————
if name=="double_not_get" then
Note(wilcards[2]);
g_go_take_double=false;
AppendToNotepad(player_enamel.."_record",line..os.date().."\r\n");
local _new_doule_time=tonumber(os.date("%H", os.time()))+(24-chinese_to_number(wilcards[2]));
if _new_doule_time>23 then
_new_doule_time=_new_doule_time-24;
end
SetTimerOption ("takedouble", "hour", _new_doule_time);
SetTimer("home",10);
wait.time(3);
ResetTimer("takedouble");---This added on 2015-02-13.
EnableTriggerGroup("takedouble",false);
Execute("move;#5(exert heal);exert recover1");
end
end)
_______________________________________________
<timer name="takedouble" enabled="y" hour="11" second="0.00" offset_second="0.00" send_to="12"
at_time="y" group="takedouble" >
<send>g_go_take_double=true;</send>
</timer>
__________________________________________________________
<trigger
group="takedouble"
lines_to_match="3"
match="^( |>)*你向李战打听有关『jobreward』的消息。\n\n^玩家可24小时领取一次任务额外奖励,持续时间6小时!!你(.+)个小时前领过!!$"
multi_line="y"
name="double_not_get"
regexp="y"
script="TakeDouble"
send_to="12"
sequence="100"
>
——————————————————————————————
if name=="double_not_get" then
Note(wilcards[2]);
g_go_take_double=false;
AppendToNotepad(player_enamel.."_record",line..os.date().."\r\n");
local _new_doule_time=tonumber(os.date("%H", os.time()))+(24-chinese_to_number(wilcards[2]));
if _new_doule_time>23 then
_new_doule_time=_new_doule_time-24;
end
SetTimerOption ("takedouble", "hour", _new_doule_time);
SetTimer("home",10);
wait.time(3);
ResetTimer("takedouble");---This added on 2015-02-13.
EnableTriggerGroup("takedouble",false);
Execute("move;#5(exert heal);exert recover1");
end
end)
now I changed the script, add "ResetTimer("takedouble")" in the function, now it is ok.
http://www.gammon.com.au/scripts/doc.php?function=ResetTimer
ResetTimer recalculates when the timer finishes.
ResetTimer recalculates when the timer finishes.
thank you