mIRC Home    About    Download    Register    News    Help

Print Thread
S
sandygws
sandygws
S
How do I 'comment out' script 2 in the script below so that it doesn't load .. but scripts 1 and 3 do?


Quote:
if ($istok(load unload,$1,32)) {
$1 -rs scripts/script1.mrc
$1 -rs scripts/script2.mrc
$1 -rs scripts/script3.mrc

T
Twitch
Twitch
T
by simply added a semi-colon to the beginning of the line, line so:

Code:
if ($istok(load unload,$1,32)) {
$1 -rs scripts/script1.mrc
;$1 -rs scripts/script2.mrc
$1 -rs scripts/script3.mrc

S
sandygws
sandygws
S
I tried that .. but now /myscripts load does not load the script frown

eg:

Quote:
alias myscripts {
if ($istok(load unload,$1,32)) {
;$1 -rs scripts/script1.mrc
$1 -rs scripts/script2.mrc

Last edited by sandygws; 15/04/12 12:24 AM.
T
Twitch
Twitch
T
Originally Posted By: sandygws
How do I 'comment out' script 2 in the script below so that it doesn't load .. but scripts 1 and 3 do?


this is exactly the behavior you asked for, for 'script2' not to load? i don't understand?

Edit: it also looks like you commented out script1, and not script2..

Last edited by Twitch; 15/04/12 12:34 AM.
S
sandygws
sandygws
S
Sorry - that was an example

myscripts.mrc is an alias used to load multiple scripts using

/myscripts load
;--OR
/myscripts unload

But when I comment out a script in myscripts.mrc by appending ;, using /myscripts load no longer works ...



So ..



Quote:
alias myscripts {
if ($istok(load unload,$1,32)) {
$1 -rs scripts/script1.mrc
$1 -rs scripts/script2.mrc
$1 -rs scripts/script3.mrc
}
}


works fine using the /myscripts load command...


but with a script commented out as follows:


Quote:
alias myscripts {
if ($istok(load unload,$1,32)) {
$1 -rs scripts/script1.mrc
;$1 -rs scripts/script2.mrc
$1 -rs scripts/script3.mrc
}
}



The /myscripts load command no longer functions.

Last edited by sandygws; 15/04/12 12:43 AM.
T
Twitch
Twitch
T
I see, try this, see if it gets past the echos..

Code:
if ($istok(load unload,$1,32)) {
echo -a Begin loading...
$1 -rs scripts/script1.mrc
echo -a before comment...
;$1 -rs scripts/script2.mrc
echo -a After comment...
$1 -rs scripts/script3.mrc

S
sandygws
sandygws
S
Thanks, but using that method will effectively double the length of the script, which is already hard to follow!

I just wanted a very quick way to disable a single script from loading without resorting to manually removing it from myscripts.mrc.

Any ideas?

T
Twitch
Twitch
T
its just a few echos, one above and one below the actual commented out line, the are only there for debug purposes, and can be removed when it is figured out why the whole script doesn't work when you comment out one line..

S
sandygws
sandygws
S
Sorry .. I'm an idiot. I had forgotten to actually load myscripts.mrc before using the /myscripts load command

Works fine now and only the loads the scripts which are not appended with the ;.

:P

Last edited by sandygws; 15/04/12 01:03 AM.
T
Twitch
Twitch
T
well, you said that the code doesn't work at all when you comment out one line, so i guess just see which, if any, of the echos you added are being executed..

It's really hard to say with out seeing some actual code...

Out of curiosity, are all the script files in the same folder?

T
Twitch
Twitch
T
oh, haha, ok, no worries.. glad its working now. ;p

S
sandygws
sandygws
S
Cheers twitch laugh


Link Copied to Clipboard