mIRC Home    About    Download    Register    News    Help

Topic Options
#237126 - 15/04/12 12:54 AM Prevent a script from loading
sandygws Offline
Babel fish

Registered: 03/05/11
Posts: 53
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

Top
#237128 - 15/04/12 12:59 AM Re: Prevent a script from loading [Re: sandygws]
Twitch Offline
Ameglian cow

Registered: 20/03/12
Posts: 38
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
_________________________
Lost in your digital reality.
#mIRC / #Helpdesk on DALnet.

Top
#237129 - 15/04/12 01:23 AM Re: Prevent a script from loading [Re: Twitch]
sandygws Offline
Babel fish

Registered: 03/05/11
Posts: 53
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


Edited by sandygws (15/04/12 01:24 AM)

Top
#237130 - 15/04/12 01:33 AM Re: Prevent a script from loading [Re: sandygws]
Twitch Offline
Ameglian cow

Registered: 20/03/12
Posts: 38
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..


Edited by Twitch (15/04/12 01:34 AM)
_________________________
Lost in your digital reality.
#mIRC / #Helpdesk on DALnet.

Top
#237131 - 15/04/12 01:38 AM Re: Prevent a script from loading [Re: Twitch]
sandygws Offline
Babel fish

Registered: 03/05/11
Posts: 53
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.


Edited by sandygws (15/04/12 01:43 AM)

Top
#237132 - 15/04/12 01:41 AM Re: Prevent a script from loading [Re: sandygws]
Twitch Offline
Ameglian cow

Registered: 20/03/12
Posts: 38
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
_________________________
Lost in your digital reality.
#mIRC / #Helpdesk on DALnet.

Top
#237133 - 15/04/12 01:45 AM Re: Prevent a script from loading [Re: Twitch]
sandygws Offline
Babel fish

Registered: 03/05/11
Posts: 53
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?

Top
#237134 - 15/04/12 01:49 AM Re: Prevent a script from loading [Re: sandygws]
Twitch Offline
Ameglian cow

Registered: 20/03/12
Posts: 38
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..
_________________________
Lost in your digital reality.
#mIRC / #Helpdesk on DALnet.

Top
#237135 - 15/04/12 01:57 AM Re: Prevent a script from loading [Re: Twitch]
sandygws Offline
Babel fish

Registered: 03/05/11
Posts: 53
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


Edited by sandygws (15/04/12 02:03 AM)

Top
#237136 - 15/04/12 02:03 AM Re: Prevent a script from loading [Re: sandygws]
Twitch Offline
Ameglian cow

Registered: 20/03/12
Posts: 38
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?
_________________________
Lost in your digital reality.
#mIRC / #Helpdesk on DALnet.

Top
#237137 - 15/04/12 02:05 AM Re: Prevent a script from loading [Re: sandygws]
Twitch Offline
Ameglian cow

Registered: 20/03/12
Posts: 38
oh, haha, ok, no worries.. glad its working now. ;p
_________________________
Lost in your digital reality.
#mIRC / #Helpdesk on DALnet.

Top
#237138 - 15/04/12 02:06 AM Re: Prevent a script from loading [Re: Twitch]
sandygws Offline
Babel fish

Registered: 03/05/11
Posts: 53
Cheers twitch laugh

Top