mIRC Home    About    Download    Register    News    Help

Print Thread
Script to load ... a script? #231857 07/05/11 09:09 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
I have a small script which automatically connects to a number of zncs when mirc launches.

However, there is a larger script which loads BEFORE the znc script .. and this causes the entire application to freeze for around 30 seconds.

Is there a way to use a script to load the larger Script A first, then Script B, say .. 20 seconds later?

Re: Script to load ... a script? [Re: sandygws] #231859 07/05/11 09:21 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
/help /load
/help /timer

Re: Script to load ... a script? [Re: DJ_Sol] #231868 08/05/11 03:53 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Thanks for the reply

My first effort isn't working.


Quote:
on *:START:.timer 1 10 /load -rs znc.mrc


to load the script below after 10 seconds

Quote:
;...:::{ Servers }:::...
on *:START:{
server -m server1 server2 server3


Does the timer 'script' need to be separate, or should the timer simply be added to the beginning of the existing znc.mrc script?


EDIT: it would also be ideal to add a 2-second delay between server1, server2, server3 if possible.

Last edited by sandygws; 08/05/11 03:57 PM.
Re: Script to load ... a script? [Re: sandygws] #231869 08/05/11 04:59 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
You can split your server line and put timers on each..

Code:
  .timer 1 2 server irc.server1.com
  .timer 1 4 server -m irc.server2.com
  .timer 1 6 server -m irc.server3.com


Change the delay to whatever works best.

As far as your on start/load option, keep in mind that unless you're unloading the script before exiting, it will be loaded already when you start mIRC. The /load command may reload it, but before that happens, it will already have started doing its on start section.


Invision Support
#Invision on irc.irchighway.net
Re: Script to load ... a script? [Re: Riamus2] #231871 08/05/11 05:28 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Thanks Riamus2,

That's a very good point.

Is there no way to unload the script - other than manually - upon mIRC exit?

Re: Script to load ... a script? [Re: sandygws] #231874 08/05/11 06:49 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
/help /unload

Re: Script to load ... a script? [Re: DJ_Sol] #231876 08/05/11 06:54 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
I've already read that - it doesn't help

Without knowing how long I need the script loaded for, how do I tell mIRC to unload it?

As far as I can see, the only way is to either manually unload it before exiting - or to instruct mIRC to unload it upon exit.

But I'm still unsure how to go about that.

Re: Script to load ... a script? [Re: sandygws] #231879 08/05/11 07:21 PM
Joined: Feb 2011
Posts: 319
K
KindOne Offline
Fjord artisan
Offline
Fjord artisan
K
Joined: Feb 2011
Posts: 319
I think this is what you are looking for.

Code:
on *:EXIT:{ /unload -rs znc.mrc }


/help , Index Tab , search for "on exit"

Edit: corrected typo in the script.

Last edited by KindOne; 08/05/11 07:39 PM.

irc.swiftirc.net #msl (mIRC Scripting Language)
Re: Script to load ... a script? [Re: KindOne] #231881 08/05/11 07:34 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Thanks smile

Where exactly should I place that text?


I've got


Quote:
.timer 1 38 server -m xxxx
}

on *:EXIT:{ /unload-rs znc.ini }


Or should it go inside the '}' after the server?

Re: Script to load ... a script? [Re: sandygws] #231883 08/05/11 07:40 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Events need to stand alone, you can't nest them in another event or alias.

on *:text:*:#:{ }
alias name { }
on *:exit:{ }

Re: Script to load ... a script? [Re: DJ_Sol] #231884 08/05/11 07:41 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Thank you!

Re: Script to load ... a script? [Re: sandygws] #231885 08/05/11 07:43 PM
Joined: Feb 2011
Posts: 319
K
KindOne Offline
Fjord artisan
Offline
Fjord artisan
K
Joined: Feb 2011
Posts: 319
Leave it on the outside, like in it is, I think that will work.
Also, please check my first post, I just corrected a typo that would cause it not to work properly.


irc.swiftirc.net #msl (mIRC Scripting Language)
Re: Script to load ... a script? [Re: KindOne] #231886 08/05/11 07:46 PM
Joined: May 2011
Posts: 53
S
sandygws Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Corrected smile

Final question: what's the difference between using script.ini or script.mrc?


Re: Script to load ... a script? [Re: sandygws] #231887 08/05/11 07:53 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Nothing really. They are just saved (formatted) differently.


Invision Support
#Invision on irc.irchighway.net