mIRC Homepage
Posted By: Stefan_Leroux Nested Alias - 25/09/07 01:03 AM
OK, I'm not entirely sure how to put this, but I'm looking for a way to effectively nest a couple fo aliases. Basically I've got a script, which works by opening various different Aliases, with actions including sockopens and restyling the data. The only way I've known how to do it is by having aliases called within each one. The problem is I need to call /msg or /describe from outwith this, but because of the socks it takes time before it works.
I need some way to call an alias, but then not call the next until the first has completed.

Can anyone tell me if theres any way to do this?
Posted By: Lpfix5 Re: Nested Alias - 25/09/07 02:00 AM
Originally Posted By: Stefan_Leroux
OK, I'm not entirely sure how to put this, but I'm looking for a way to effectively nest a couple fo aliases. Basically I've got a script, which works by opening various different Aliases, with actions including sockopens and restyling the data. The only way I've known how to do it is by having aliases called within each one. The problem is I need to call /msg or /describe from outwith this, but because of the socks it takes time before it works.
I need some way to call an alias, but then not call the next until the first has completed.

Can anyone tell me if theres any way to do this?


The way I would approach this is add a timer to the next event of x amount of seconds like this

alias myscript {
/blah
/blah
./timer 1 2 /newblah
./timer 1 3 /blah
}

etc..

by calling the next timer 1 time for 2 seconds it should allow enough time then the next timer should follow by an extra second.
Posted By: Riamus2 Re: Nested Alias - 25/09/07 02:24 AM
If you need to wait until the socket is done, why not just call the next alias from the sockclose event?
Posted By: Stefan_Leroux Re: Nested Alias - 25/09/07 03:32 AM
Well, the best way would be for me to use the timer, but when it gets called it keeps saying in active that it has begun, and ended. It would be the ideal solution if I could stop the started/stopped messages appearing.

I cant call the final alias from the sockclose, because the final alias is not a definite one. I want it to vary between /msg /me /ctcp depending on the command sent, and because of the huge amount of lines in the script, I dont really want to duplicate it just for such subtle differences
Posted By: LonDart Re: Nested Alias - 25/09/07 03:37 AM
You can silence those timer messages by using the "." in front of it.

Code:
 .timerquiet 1 1 echo -s I'm a well-behaved timer!
Posted By: Stefan_Leroux Re: Nested Alias - 25/09/07 03:52 AM
that will do absolutely perfectly then, thanks mate

- Apparently thats the only thing in this script that I havent used a '.' for. I learned it years ago, and never used a '/' since, although never realised it had a special function until recently
Posted By: Lpfix5 Re: Nested Alias - 25/09/07 02:35 PM
Originally Posted By: Stefan_Leroux
that will do absolutely perfectly then, thanks mate

- Apparently thats the only thing in this script that I havent used a '.' for. I learned it years ago, and never used a '/' since, although never realised it had a special function until recently


Steph, if you notice in my original post I added a . in back of the timer already, you shouldnt of received any messages
Posted By: Stefan_Leroux Re: Nested Alias - 25/09/07 03:39 PM
Sorry Lpfix5, I never actually noticed that, and because I already had it working via a timer, I didnt copy your code down, so it was my issue. Thanks though, I'll pay much more attention next time
© mIRC Discussion Forums