mIRC Homepage
Posted By: Stealth Dynamic Aliases - 14/01/07 06:57 AM
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
Posted By: Scripto Re: Dynamic Aliases - 14/01/07 10:06 AM
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.
Posted By: starbucks_mafia Re: Dynamic Aliases - 14/01/07 03:08 PM
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.
Posted By: Om3n Re: Dynamic Aliases - 14/01/07 03:21 PM
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).
Posted By: Stealth Re: Dynamic Aliases - 14/01/07 04:48 PM
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
Posted By: starbucks_mafia Re: Dynamic Aliases - 14/01/07 05:16 PM
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.
© mIRC Discussion Forums