Reconnecter Delay

Posted by Chyort on Sun 13 Jan 2008 10:33 PM — 4 posts, 19,360 views.

USA #0
Upon disconnecting the stock reconnecter immediately tries to reconnect, and then waits how ever many seconds you have it set up to wait. What im trying to do is make a delay before it ever starts trying to reconnect. Basicly wait Y seconds/minutes before attempting to reconnect ever X seconds/minutes.

Since i cant just do a simple doafter and have it active while disconnected i came up with 2 triggers and a timer. It works. but its sporadic at best... I get a couple reconnects at the proper time, and then it starts to vary wildy, anywhere from the 9 minutes its suposed to wait, down to under 1 minute... With my fairly limited knowledge of scripting/what not, im stuck.

Anyways, first trigger executes a quit, and enables the relog timer. the timer then waits 9 minutes before executing connect. turning the reconecter back on, and the 2nd trigger turns the relog timer back off and resets all my timers.

any help would be appreciated, Oh and im running version 4.01 if that matters

*Edit* went digging thru the forums a bit more and found that you cant reset disabled timers... so i moved the reset to right after the timer is enabled.

<triggers>
  <trigger
   back_colour="8"
   enabled="y"
   keep_evaluating="y"
   match="* says 'relog'"
   match_back_colour="y"
   match_text_colour="y"
   send_to="12"
   text_colour="10"
  >
  <send>DoAfterSpecial 1, "quit", 10
EnableTimer "relog", TRUE</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   back_colour="8"
   enabled="y"
   match="Welcome to Realms of Despair, *..."
   match_back_colour="y"
   match_text_colour="y"
   send_to="12"
   sequence="1"
   text_colour="12"
  >
  <send>enabletimer "relog", false
DoCommand "ResetAllTimers"</send>
  </trigger>
</triggers>

<timers>
  <timer name="relog" minute="9"    send_to="10"
active_closed="y" >
  <send>connect</send>
   </timer>
</timers>
Amended on Mon 14 Jan 2008 04:17 AM by Chyort
Australia Forum Administrator #1
See:

http://www.gammon.com.au/scripts/doc.php?function=ResetTimer

Enabling a timer does not reset when it will fire. Enable it first then reset it, to start the 9 minute countdown.
Australia Forum Administrator #2
Quote:

enabletimer "relog", false
DoCommand "ResetAllTimers"


First, I would not do it via DoCommand, that is a roundabout way of achieving it. Use this instead:

http://www.gammon.com.au/scripts/doc.php?function=ResetTimers


Second, since you have disabled it (by using false) the reset will not apply to it.
USA #3
yeah. i had allready found my stupid mistake about trying to reset a disabled timer after browsing the forums for another hour or so after my post :P was still having the problem...

Fixed the round about way i was trying to reset the timer, and got a dozen reconnects or so on time. before the mud crashed. so lets hope its fixed for good