mIRC Home    About    Download    Register    News    Help

Print Thread
#15172 13/03/03 11:30 AM
T
tenbucks
tenbucks
T
I see this in a lot of scripts but no mention anywhere that I've looked. Can someone tell me what -l does?
thx

#15173 13/03/03 11:36 AM
S
Sabby
Sabby
S
-l is a switch that limits the alias in only performing in that script.

IE, the script itself can perform it but the user can not...
lets say there is: alias -l hello echo -a hi in script.mrc

If the script.mrc used the command /hello it would echo hi,
but if the user just typed /hello it wouldn't

#15174 13/03/03 12:38 PM
T
tenbucks
tenbucks
T
Thanks a lot smile

I'm really puzzled why this isn't contained in the help file smirk

How did people that use this find out about it? I searched here, the web, the help file, etc with no luck.

Just Curious

#15175 13/03/03 01:19 PM
T
theRat
theRat
T
it's there =P

/help aliases
Look from "Remote scripts" part

#15176 13/03/03 02:37 PM
T
tenbucks
tenbucks
T
duh, ok me stupid

Remote Scripts
You can add aliases to remote scripts by using the alias prefix and then entering your alias as usual.

alias add {
%x = $1 + $2
return %x
}

This is the same custom identifier as above, except it uses the alias prefix.

If you specify the -l switch in the alias definition, the alias becomes accessible only by commands in the same script and invisible to the command line and other scripts.

alias -l add {
%x = $1 + $2
return %x
}


#15177 14/03/03 05:26 AM
J
Jagfire
Jagfire
J
It's usually handy when you're looking to use an alias name that you're comfortable scripting with. By making it local, the alias won't conflict with any other loaded scripts that the user has.

I always use it.

#15178 14/03/03 11:02 AM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Just out of curiosity, how would this work then?

I have 2 script files loaded.

Say I have an alias in file myscript.ini:

Code:
alias myalias {
  echo -a Hello this is your alias!
}


and this in file otherscript.ini:
Code:
on *:JOIN:*:{
  /myalias
}
alias -l myalias {
   echo -a Hello this is your other alias
}


Which would the on JOIN event use?

Would it automatically look in the same script file first and if there's a local alias, use that, if not, look in other script files?

If this is the case, how would I get it to use the myalias alias from myscript.ini instead of the local alias?

Don't know if I've explained this properly, but thanks in advance to anyone (if anyone does!) that explains it smile

#15179 14/03/03 11:29 AM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
"Would it automatically look in the same script file first and if there's a local alias, use that, if not, look in other script files?"

Why don't you try it? To save you the trouble, it will use the local alias.


"If this is the case, how would I get it to use the myalias alias from myscript.ini instead of the local alias?"

You can't.

#15180 14/03/03 12:16 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
tnx qwerty, Don't know why I didn't try it!!!! lol, sorry crazy
and thanks for the other bit smile

Would it be a "feture suggestion" to be able to choose which alias it uses(local/global)? Not that I have a use for it at this time though!

#15181 14/03/03 04:10 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
It wouldn't be much of a feature really, if you know you'll want to use another alias with a certain name then just don't make a local alias with that name.

#15182 14/03/03 05:11 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Yeah, suppose so... wink


Link Copied to Clipboard