mIRC Homepage
Posted By: Hampus Timer executing multiple commands? - 11/08/04 10:45 AM
I'm having a hard time getting the following timer to work:

//timer $+ %timernr 1 %time //writeini filename.ini %id %res 1 | //writeini filename.ini %id status 0

It's the two seperate commands that mIRC doesn't seem to handle very well. It executes the first command "//writeini filename.ini %id %res 1" beautifully when the timer expires, but the part after the "|" gets executed right away.

I know that having two timers would be a solution, but I'm keeping that as a last resort.

Can anyone help me out here?
Posted By: Naz Re: Timer executing multiple commands? - 11/08/04 10:54 AM
Put your two commands in an alias then have the timer call the alias.

//timer $+ %timernr 1 1 writestuff

alias writestuff {
writeini filename.ini %id %res 1
writeini filename.ini %id status 0
}

%timernr would become part of the timers name with the $+ there, so I added an extra '1' in there.
Posted By: Coolkill Re: Timer executing multiple commands? - 11/08/04 11:00 AM
Alternatively, change the | to $chr(124) (the ascii value of it).

//timer $+ %timernr 1 %time //writeini filename.ini %id %res 1 $chr(124) //writeini filename.ini %id status 0

Eamonn.

Posted By: Hampus Re: Timer executing multiple commands? - 11/08/04 11:16 AM
I've tried that solution as well... And yes.. %timernr would become a part of the timers name. U've missed the %time variable, in which case the extra 1 U've added becomes unnecessary smile

But here's why the solution doesn't work. (I probably should have been more specific when I first posted this problem and for that I apologize)

The timer is triggered by user1 which stores his "numbers" in the variables and then the timer starts.
But before the timer runs out, user2 triggers the timer, and then the numbers stored in the variables by user 1 will be overwritten.

I could of cause create a unique var for each user, but that will leave a giant mess as the number of users start to rise.
Posted By: Hampus Re: Timer executing multiple commands? - 11/08/04 11:22 AM
Ok.. Coolkill... U're a lifesaver.

It works perfectly.. Thx a bunch smile
Posted By: Coolkill Re: Timer executing multiple commands? - 11/08/04 11:27 AM
Your Welcome smile
© mIRC Discussion Forums