mIRC Home    About    Download    Register    News    Help

Print Thread
#168773 14/01/07 06:57 AM
Joined: Sep 2003
Posts: 149
S
Stealth Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Sep 2003
Posts: 149
It would be great to be able to specify a varable or idenitfier for an alias.

Somthing like:
Code:
alias %alias { do something }

Then you can simply set %alias to whatever you want, and that becomes you alias.

This would be great for addons, because it would make it easy to make the script commands changable by the user

Stealth #168776 14/01/07 10:06 AM
S
Scripto
Scripto
S
I think I'd second that

/%alias <~~ making it possible for any returned value to be variably set as an alias, or identifier. $%alias

Thats getting kinda trick, but i think it would have some potential. You could stack things up quick.

Stealth #168786 14/01/07 03:08 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
What's wrong with just creating custom aliases for whatever the user wants to call the original alias? ie.

Code:
on *:dialog:myoptionsdialog:close:*:{
  alias $did(123) my_original_aliasname $!1-
}


That way your code is a lot easier to work with, doesn't conflict with mIRC's existing ability to use %somevariable at the start of the line to dynamically call regular aliases (with optional parameters), and also doesn't raise the issue of what happens if the variable is deleted or contains an invalid alias name.

Stealth #168788 14/01/07 03:21 PM
O
Om3n
Om3n
O
you could also use ON INPUT to check if /personalisedalias == %aliasname and call the real alias that way

Of corse with all methods of creating dynamic alias names you have to take into concideration possible conflicting alias names (more important when using them as identifiers than in command line i guess).

Stealth #168790 14/01/07 04:48 PM
Joined: Sep 2003
Posts: 149
S
Stealth Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Sep 2003
Posts: 149
on INPUT may interfere with other scripts the user has loaded, and /alias will add the file to the aliases file, which will not keep the script contained in its own file

Stealth #168791 14/01/07 05:16 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
You could easily include an alias file with your script for this purpose and then use alias myscriptsaliasfile.mrc ....

Given the issues I mentioned in my other post, I'd much rather see the alias command given the ability to create aliases in remote files then see what hacks and half-measures would be needed to solve the problems your suggestion raises.

Incidentally why are you allowing people to rename existing commands? Why not give them simple commands to begin with? After all, they have to know the name and purpose of each command in the first place to know what it is they're renaming.


Link Copied to Clipboard