A timmer issue for mushclient 4.61

Posted by Lonestar42 on Sat 01 Jun 2013 04:40 AM — 9 posts, 30,798 views.

#0
Hi Gammon:
I'm new user for mushclient from china, I got strange problem for timmer in mushclient. I ran a lua script on a VPS(Virsual Private Server, OS: windows XP). Sometimes the timer in mush will be reset to over 20 minutes...
e.g: I add a timer to "say:hello" every 5 minutes, But after a while(maybe 20 minutes), I found the timer indicate the next "say hello" time is after 20 minutes.
I guess maybe the mushclient has some compatbility problem with some hardware or OS? how Can I do some trouble shooting for this issue?

Thanks
BRs
your fans.
Australia Forum Administrator #1
Please post your timer.

Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
#2
Nick Gammon said:

Please post your timer.

(copying)


Hi:
The script I used is same as other players in same mud. They do not have such problem. Meanwhile, I try it on the real PC(Not a VPS), it seems work well(run about 2 hours, no any idle and the timer works fine).I tried on 4.84, the issue can be reproduced too.

Please check this screenshot when issue happens:
http://farm4.staticflickr.com/3786/8935844388_5e13c53433_o.jpg
The XML when issue happens:

<timers>
  <timer name="timeup_li" enabled="y" minute="1" second="15.00" offset_second="0.00"    send_to="12"
>
  <send>g_quests.li.timeup = true</send>

  </timer>
</timers>



<timers>
  <timer name="home" enabled="y" minute="1" second="30.00" offset_second="0.00"    send_to="12"
group="home" >
  <send>home()</send>

  </timer>
</timers>


below is the normal codtion's timer:



<timers>
  <timer name="home" enabled="y" minute="1" second="0.00" offset_second="0.00"    send_to="12"
group="home" >
  <send>home()</send>

  </timer>
</timers>



<timers>
  <timer name="timeup_li" enabled="y" minute="1" second="15.00" offset_second="0.00"    send_to="12"
>
  <send>g_quests.li.timeup = true</send>

  </timer>
</timers>

Amended on Mon 03 Jun 2013 01:37 PM by Lonestar42
Australia Forum Administrator #3
The script might be changing the timer interval. Hard to say without seeing it.
#4
Nick Gammon said:

The script might be changing the timer interval. Hard to say without seeing it.


Hi, thanks for your reply, below is the function of setTimer in script:


function SetTimer(name, secs)
	local minute = 0;
	if secs >= 60 then
		minute = math.floor(secs/60);		
		SetTimerOption(name,"minute",minute);
		secs = secs - minute*60;
	end
	SetTimerOption(name, "minute", minute);
	SetTimerOption(name, "second", secs);
	ResetTimer(name);
end

I guess setTimerOption and ResetTimer is the System function. But I cannot see any tricky part in here.

BRs
Australia Forum Administrator #5
I don't know, but maybe print out the new timer settings after resetting it to be sure it is right.
#6
Nick Gammon said:

I don't know, but maybe print out the new timer settings after resetting it to be sure it is right.


How Can I print out the new timer settings? thanks.
Australia Forum Administrator #7

function SetTimer(name, secs)
  local minute = 0;
  if secs >= 60 then
    minute = math.floor(secs/60);   
    SetTimerOption(name,"minute",minute);
    secs = secs - minute*60;
  end
  SetTimerOption(name, "minute", minute);
  SetTimerOption(name, "second", secs);
  ResetTimer(name);

  print ("minute = ", GetTimerOption(name, "minute"));
  print ("second = ", GetTimerOption(name, "second"));


end

Australia Forum Administrator #8
Also:

Template:function=GetTimerInfo
GetTimerInfo

The documentation for the GetTimerInfo script function is available online. It is also in the MUSHclient help file.