mIRC Homepage
Posted By: lrdv timers - 26/12/02 01:58 PM
I currently have multiple timers that post info into a channel throughout the day. I have looked in the mIRC help file and I can't understand how to have them perform the same timer on a daily basis without having to quit and restart the server.

Any help would be grealy appreciated.

Posted By: tomalak16 Re: timers - 26/12/02 02:11 PM
What do you mean ? Why would you quit/restart the server?
Posted By: NaquadaServ Re: timers - 26/12/02 02:44 PM
You really need to read "/help /timers" over again.. hehe...

Here is an example that may help you....
Code:
 
; Say something on every hour, but don't use 24 timers....
alias on-the-hour {
  var %NextHour $calc($asctime(hh) + 1)
  set %NextHour $iif(%NextHour > 23, 00, %NextHour) $+ :00
  var %Repetitions 1
  var %Delay 0
  ; First run, or called by a timer?
  if ($ctimer != $null) { 
    ; Do something here
  }
  ; Start timer for next hour, make if an offline (-o) timer
  .timerOnTheHour -o %NextHour %Repetitions %Delay on-the-hour
}
Posted By: lrdv Re: timers - 26/12/02 03:38 PM
Quote:
You really need to read "/help /timers" over again.. hehe...
yeah.. I have.. over and over and over smile

I have the following in my Options/Perform

/timer 7:30 1 1 /msg #options 4Stock & Option Market Open "Good Luck Fellow Traders"
/timer 13:45 1 1 /msg #options 4Last 15 mins of Trading
/timer 14:00 1 1 /msg #options 4Stock Market Closed "Afterhour Trading In Effect"
/timer 14:02 1 1 /msg #options 4Equity Option Market Closed
/timer 14:15 1 1 /msg #options 4Globex Market Closed
/timer 18:00 1 1 /msg #options 2After Hour Trading 4"Closed"

So I want to have the same thing posted every weekday. As it is now it posts once and halts and I have to quit and restart the server to re-activate the timer for the next day.

Posted By: Hammer Re: timers - 26/12/02 04:37 PM
You might try setting the <repetitions> value to 0 (which means repeat indefinitely) and setting the <duration> value to 86400 (which is the number of seconds in 24 hours):
Code:

.timer 07:30 0 86400 msg #options 4Stock &amp; Option Market Open "Good Luck Fellow Traders"
.timer 13:45 0 86400 msg #options 4Last 15 mins of Trading
.timer 14:00 0 86400 msg #options 4Stock Market Closed "Afterhour Trading In Effect"
.timer 14:02 0 86400 msg #options 4Equity Option Market Closed
.timer 14:15 0 86400 msg #options 4Globex Market Closed
.timer 18:00 0 86400 msg #options 2After Hour Trading 4"Closed"

Posted By: gemeau50 Re: timers - 26/12/02 04:48 PM
Personnally I do not trust /timer to evaluate huge amount of seconds

I would go this way:

alias starttimerlist timer 00:00 1 1 starttimer

alias -l starttimer {
timer 1 120 starttimerlist
timerlist
}

alias -l timerlist {
timer 7:30 1 1 /msg #options 4Stock & Option Market Open "Good Luck Fellow Traders"
timer 13:45 1 1 /msg #options 4Last 15 mins of Trading
timer 14:00 1 1 /msg #options 4Stock Market Closed "Afterhour Trading In Effect"
timer 14:02 1 1 /msg #options 4Equity Option Market Closed
timer 14:15 1 1 /msg #options 4Globex Market Closed
timer 18:00 1 1 /msg #options 2After Hour Trading 4"Closed"
}

To start the process:
/starttimerlist
Posted By: lrdv Re: timers - 26/12/02 05:38 PM
Quote:
Personnally I do not trust /timer to evaluate huge amount of seconds

I would go this way:

Thanks.. Were would I place this script? Perform or Alias?
Posted By: gemeau50 Re: timers - 26/12/02 05:51 PM
As is, it goes in a remote file

To put it in alias file, some modifications would be required.

starttimerlist timer 12:48 1 1 starttimer

starttimer {
timer 1 120 starttimerlist
timerlist
}

timerlist {
timer 7:30 1 1 /msg #options 4Stock & Option Market Open "Good Luck Fellow Traders"
timer 13:45 1 1 /msg #options 4Last 15 mins of Trading
timer 14:00 1 1 /msg #options 4Stock Market Closed "Afterhour Trading In Effect"
timer 14:02 1 1 /msg #options 4Equity Option Market Closed
timer 14:15 1 1 /msg #options 4Globex Market Closed
timer 18:00 1 1 /msg #options 2After Hour Trading 4"Closed"
}
Posted By: lrdv Re: timers - 26/12/02 10:30 PM
Quote:
As is, it goes in a remote file

To put it in alias file, some modifications would be required.

Thanks for your help...
Posted By: gemeau50 Re: timers - 27/12/02 01:09 AM
You're welcome!
Posted By: lrdv Re: timers - 01/01/03 03:42 PM
Quote:
As is, it goes in a remote file


Now that I got that part working I would like to expand this script to test for Week-Day and only post it during Monday - Friday.

Posted By: gemeau50 Re: timers - 01/01/03 05:38 PM
starttimer {
timer 1 120 starttimerlist
if (($asctime(dddd) == saturday) || ($asctime(dddd) == sunday)) return
timerlist
}
Posted By: lrdv Re: timers - 01/01/03 08:28 PM
Thanks again and Happy Prosperous New Year to you. cool
Posted By: Nimue Re: timers - 01/01/03 09:06 PM
I think using $day would be better smile
if ($day isin Saturday Sunday) return
© mIRC Discussion Forums