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


mIRC 6.21 - Win XP Pro (SP2) - 2.4 Ghz - 1 GB Mem
irc.x-tab.org
Stealth #168776 14/01/07 10:06 AM
Joined: Dec 2006
Posts: 80
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
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.


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Stealth #168786 14/01/07 03:08 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Stealth #168788 14/01/07 03:21 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
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).


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
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


mIRC 6.21 - Win XP Pro (SP2) - 2.4 Ghz - 1 GB Mem
irc.x-tab.org
Stealth #168791 14/01/07 05:16 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard