|
Joined: Aug 2004
Posts: 147
Vogon poet
|
OP
Vogon poet
Joined: Aug 2004
Posts: 147 |
I would like to see this: alias -s hello* {
if ($1 == alan) echo -a someone just did /helloalan
elseif ($1 == cat) echo -a someone just did /hellocat
} So you could do /helloanything and it would call the hello alias. Just like /timer
|
|
|
|
Joined: Mar 2004
Posts: 457
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 457 |
why this when you can do "/hello anything" already.
|
|
|
|
Joined: Aug 2004
Posts: 147
Vogon poet
|
OP
Vogon poet
Joined: Aug 2004
Posts: 147 |
Just another way to do stuff.
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
What's the benefit though? The only one I can think of is to do something like alias -s * { ... } to make a custom handler for non-existent aliases, but that could be done in a far more elegant way IMO without creating the 'mess' of commands like the one you demonstrated in your post.
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
I'd just like it because whenever I write an addon, I use alias <addon name>.<function> { }, with this I could use alias <addon name>.* { } instead of making xx aliases.
New username: hixxy
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
You mean something like this? alias blah.cmd1 { ... }
alias blah.cmd2 { ... }
alias blah.cmd3 { ... } becoming alias -s blah.* {
if ($1 == cmd1) { ... }
if ($1 == cmd2) { ... }
if ($1 == cmd3) { ... }
} If I'm understanding you correctly it seems to be at best no better than the current way, and at worst very very inefficient.
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
Yeah, like that, I prefer to shove code into one event/alias/whatever if possible, for example, I check $devent in on *:dialog:name:*:*:{ } instead of using on *:dialog:name:event:*:{ }. Edit: compact wasn't the right word
Last edited by tidy_trax; 11/12/04 06:10 PM.
New username: hixxy
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
But the code isn't anymore compact, it's just indented and probably a lot slower than before.
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Aug 2004
Posts: 147
Vogon poet
|
OP
Vogon poet
Joined: Aug 2004
Posts: 147 |
But the code isn't anymore compact, it's just indented and probably a lot slower than before. And you're getting that from where?
|
|
|
|
Joined: Oct 2003
Posts: 96
Babel fish
|
Babel fish
Joined: Oct 2003
Posts: 96 |
He's getting that from logic.
|
|
|
|
Joined: Aug 2004
Posts: 147
Vogon poet
|
OP
Vogon poet
Joined: Aug 2004
Posts: 147 |
How so? Doing this
alias myalias.one { }
alias myalias.two { }
alias myalias.three { }
as opposed to
alias myalias.* {
if ($1 == one) { }
elseif ($1 == two) { }
elseif ($1 == three) { }
}
would involve almost the same amount the same amonut of phrasing and would not make the script run slower.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
option 1
alias myalias.one { 20 lines of code }
alias myalias.two { 20 lines of code }
alias myalias.three { 20 lines of code }
option 2
alias myalias.* {
if ($1 == one) { 20 lines of code }
elseif ($1 == two) { 20 lines of code }
elseif ($1 == three) { 20 lines of code }
}
FOR /myalias.three option one the alias name locator runs, and said 20 lines of code are pharsed. option two the alias locator runs, and 1 IF statment is evaluated , 20 lines passed over, 2nd IF evaluated, 20 lines passed over, 3rd IF evaluated, 20 lines of code are pharsed. I feel that there maybe some pharsing envolved in passing over the 20 lines, even if not there is still 3 IF evaluations to do. Also since ALIAS BLAH.one is a legal alias name, the alias locator would need to make a full pass over all alias and remotes files, looking for BLAH* and also BLAH.one, since it would only run BLAH* if no blah.one alias existed. I well acknowledge I have no real knowledge of how the internal workings of mirc work to locate aliases, but since u can add them to files on the fly and effect the alias files on the fly , i would hazzard a guess that each call produces a sweep through all alias and remote files.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
Would override alias my.* {
if ($1 == one) { }
} Btw, I suggested this a while ago.
New username: hixxy
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
Yes it may override it, but with a regular alias mIRC can simply run the alias whenever it coms across one with that name, whereas with a wildmask it would have to parse every alias and remote file regardless to make sure there were no overriding aliases.
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Aug 2004
Posts: 147
Vogon poet
|
OP
Vogon poet
Joined: Aug 2004
Posts: 147 |
How bout, first come first serve?
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
Tidy_Trax : Would override Yeah i said that as well, but as Starbucks_mafia said, its gonna have to sweep the whole lot to see if there is one to override it. How bout, first come first serve? Massively bad idea. I dont want my alias called /linker.botstart when called causing someone else alias called /linker* to run. Different thing but same type of problem, i would like it if people would name there /SET variables better. I really find it quite amazing that some people well write scripts with /SET values like %hold and %work, your really asking for trouble unless you give them script specific names, ie: i use for say a help bot %djc.hb.whatever (djc is my initials, hb for helpbot, whatever is well whatever) which means your values and someone elses well never cross, i have seen that some fileservers have moved completely away to using a hash table for everything, thats quite clever but a bit over the top for a small script. Sorry im ranting again....
|
|
|
|
Joined: Aug 2004
Posts: 147
Vogon poet
|
OP
Vogon poet
Joined: Aug 2004
Posts: 147 |
Well if there are two aliases with the same name, mIRC takes the first one.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
Well if there are two aliases with the same name, mIRC takes the first one. Whats that ment to mean? I never gave an example of a problem if there were two identicly named aliases.
|
|
|
|
Joined: Aug 2004
Posts: 147
Vogon poet
|
OP
Vogon poet
Joined: Aug 2004
Posts: 147 |
That's what we were talking about, what if there was an alias named hello.hi and an alias hello.*, which one would be called.
|
|
|
|
Joined: Mar 2004
Posts: 540
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 540 |
Basically should mIRC pick /hello* in the alias section or /hello in the remote section if they are both on the top line in the first script loaded in each section. Personaly this is a waste of time and cpu the way it is is the best imho.
|
|
|
|
|