|
Joined: Aug 2003
Posts: 319
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Aug 2003
Posts: 319 |
I created a scriptwin alias and called it with "$scriptwin" but instead I got the results as if I had called "$script $+ win".
|
|
|
|
Joined: Jul 2006
Posts: 4,144
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,144 |
That's not a bug, some identifier such as $script allow you to stick text after them as though $+ were used
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Aug 2003
Posts: 319
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Aug 2003
Posts: 319 |
That's not a bug, some identifier such as $script allow you to stick text after them as though $+ were used Can you tell me where this is documented?
|
|
|
|
Joined: Jan 2004
Posts: 2,127
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 2,127 |
If you want to use this alias, you can still use it as a command. /scriptwin these are the parameters There are several others which do this: //echo -a $getdirABC
//echo -a $mididirABC
//echo -a $mircdirABC
//echo -a $mircexeABC
//echo -a $mp3dirABC
//echo -a $scriptdirABC
//echo -a $wavedirABC It looks like what they have in common is that they don't need () in order to return a folder/file name.
|
|
|
|
Joined: Jul 2006
Posts: 4,144
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,144 |
Some of this usage might be documented in versions.txt but this discussion actually came up on IRC with Sat, he ran a code testing all identifiers using :error from a list I had, the list wasn't that complete (~20 missing maybe) but it should be good: $+,$++,$?,$?*,$*,$cd,$feof,$ferr,$getdir,$inmidi,$inmp3,$insong,$insong.pause,$inwave,$logdir,$mididir,$mircdir,$mircexe,$mircini,$mouse.key,$mouse.x $mouse.y,$mouse.win,$mouse.mx,$mouse.my,$mouse.lb,$mouse.dx,$mouse.dy,$mp3dir,$script,$scriptdir,$scriptline,$snicks,$wavedir
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Aug 2003
Posts: 319
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Aug 2003
Posts: 319 |
Why should "$scriptwin" act like "$script $+ win"? After all if you wanted it to act like that you could have coded "$script $+ win".
This still feels like a bug to me even if the boundaries have been mapped by experimentation.
|
|
|
|
Joined: Apr 2004
Posts: 871
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 871 |
As Wims mentioned, it is documented in versions.txt. See mIRC v5.7 point 100.
Saturn, QuakeNet staff
|
|
|
|
Joined: Aug 2003
Posts: 319
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Aug 2003
Posts: 319 |
What that point says is that it is a bug, but that a decision was made not to fix it for specific identifiers in order not to break some scripts which were poorly coded.
I can understand this decision as a short-term expediency, however IMO it would have been better to deprecate it in 5.7, issue warnings in 6.x and fix it in 7.x.
Or even perhaps to deprecate it in 5.7, to auto-fix the code in 6.x and revert to correct behaviour in 7.x.
|
|
|
|
Joined: Apr 2004
Posts: 871
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 871 |
It is not a bug, because it is now intended behavior, even if (in retrospect) undesirable. Bugs are by definition unintended.
mIRC tries very hard to avoid breaking backward compatibility with older scripts, so the approach that you describe simply will not happen. There is no real point in discussing it either, because Khaled has indicated many many times that this is how he approaches such cases. And ultimately it is his call, whether we agree with it or not (in this case I am impartial, FWIW).
Saturn, QuakeNet staff
|
|
|
|
Joined: Aug 2003
Posts: 319
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Aug 2003
Posts: 319 |
|
|
|
|
Joined: Feb 2003
Posts: 2,812
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 2,812 |
mSL is not supposed to be a pretty language, nor even a consistent one. It has 20 years of evolution, and it does the job fine if you read the documentation and experiment a little. There are dozens of ways to accomplish any task, and many of us just enjoy the puzzling nature of it all.
I'm glad we don't have to worry about Python 2 vs Python 3 around here.
Well. At least I won lunch. Good philosophy, see good in bad, I like!
|
|
|
|
Joined: Jan 2004
Posts: 2,127
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 2,127 |
The list posted by Ouims is a list of $identifiers and $identifier.properties which don't trigger the "no such identifier" warning, which means you can't name your own aliases within those namespaces until mIRC is fixed to allow creating alias names in some of those areas. Most of the items in the list do not report the appended text, returning the same thing whether or not there is appended text (even if it's $null), so Khaled would probably be safe in fixing those identifiers. For example, $scriptlineAPPENDEDTEXT returns the script line number regardless whether or not there is appended text.
So far, I've identified only the following identifiers that alter the output to include the appended text:
$cd,$getdir,$logdir,$mididir,$mircdir,$mircexe,$mircini,$mp3dir,$script,$scriptdir,$wavedir
The above list is probably the only ones that need to preserve the existing behavior. The above identifiers are divided into those which return a folder-only and those who return folder\filename. The reason for appending text to the identifier is for changing c:\path\ into c:\path\filename.ext, and I don't see it being that useful for appending to a filename.ext.
I might have missed a few identifiers that only exist within narrow contexts. For example, $cd only works within ON SERV, where $cdABC appends ABC to the foldername returned by $cd. However from the editbox $cd and $cdABC both return $null.
|
|
|
|
Joined: Apr 2004
Posts: 871
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 871 |
Good points, fully agreed.
Saturn, QuakeNet staff
|
|
|
|
|