mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2009
Posts: 6
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Oct 2009
Posts: 6
Sorry to trouble you all again, I just can't seem to fix this. I want to create a script so that when I'm connected to a server (at any time), it will activate a timer when the time on my computer is at a certain time. I have something similar to this:

Code:
on *:connect: { if ($asctime(HH:nn:ss) = 18:28:00) { /timer1 0 2400 /msg #channel This is a timer test that will say a message to channel #channel at 6:28 P.M. } }


The reason my time format is HH:nn:ss is that my timestamps is like that. My system time is in HH:mm so what would be the right code to get it working? Thanks for the help I can get.

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Your if statement will only be evaluated at the time you connect, so what you want cannot be achieved in this way. Instead you can use the time parameter of /timer to accomplish the same thing, for example: /timer 18:28 1 0 /msg #channel foobar

That timer will only trigger once. If you wish to perform the same action every day you can use two timers as so:

Code:
on *:CONNECT:{
  timer 18:28 1 0 /msg #channel foo
  timer 18:28 0 86400 /msg #channel bar
}

The first message (foo) will be sent at 18:28, the second (bar) will be sent 86400 seconds (24 hours) after the first and will repeat at that interval.

Joined: Oct 2009
Posts: 6
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Oct 2009
Posts: 6
Alright, thanks for the response. With a little tweaking I was able to get it going correctly. Again, thanks.


Link Copied to Clipboard