mIRC Home    About    Download    Register    News    Help

Print Thread
#15172 13/03/03 11:30 AM
Joined: Feb 2003
Posts: 20
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Feb 2003
Posts: 20
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
Joined: Jan 2003
Posts: 94
S
Babel fish
Offline
Babel fish
S
Joined: Jan 2003
Posts: 94
-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


-
E-Mail: mirc_sabby@hotmail.com
Network: irc.enterthegame.com
Channel: #Helpdesk
#15174 13/03/03 12:38 PM
Joined: Feb 2003
Posts: 20
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Feb 2003
Posts: 20
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
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
it's there =P

/help aliases
Look from "Remote scripts" part


Code:
//if ( khaled isgod ) echo yes | else echo no
#15176 13/03/03 02:37 PM
Joined: Feb 2003
Posts: 20
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Feb 2003
Posts: 20
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
Joined: Mar 2003
Posts: 54
J
Babel fish
Offline
Babel fish
J
Joined: Mar 2003
Posts: 54
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


Aubs.
cool

#15179 14/03/03 11:29 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
"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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#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!


Aubs.
cool

#15181 14/03/03 04:10 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#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


Aubs.
cool


Link Copied to Clipboard