mIRC Home    About    Download    Register    News    Help

Topic Options
#261597 - 22/10/17 01:18 PM $scriptwin alias identifier bug
Protopia Offline
Fjord artisan

Registered: 30/08/03
Posts: 226
Loc: UK
I created a scriptwin alias and called it with "$scriptwin" but instead I got the results as if I had called "$script $+ win".

Top
#261598 - 22/10/17 02:22 PM Re: $scriptwin alias identifier bug [Re: Protopia]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3503
Loc: France
That's not a bug, some identifier such as $script allow you to stick text after them as though $+ were used
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#261599 - 22/10/17 02:31 PM Re: $scriptwin alias identifier bug [Re: Wims]
Protopia Offline
Fjord artisan

Registered: 30/08/03
Posts: 226
Loc: UK
Originally Posted By: Wims
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?

Top
#261600 - 22/10/17 05:53 PM Re: $scriptwin alias identifier bug [Re: Protopia]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1144
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:

Code:
//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.

Top
#261601 - 22/10/17 06:55 PM Re: $scriptwin alias identifier bug [Re: Protopia]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3503
Loc: France
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
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#261603 - 22/10/17 07:44 PM Re: $scriptwin alias identifier bug [Re: Wims]
Protopia Offline
Fjord artisan

Registered: 30/08/03
Posts: 226
Loc: UK
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.

Top
#261604 - 22/10/17 07:58 PM Re: $scriptwin alias identifier bug [Re: Protopia]
Sat Offline
Hoopy frood

Registered: 19/04/04
Posts: 838
Loc: The Netherlands
As Wims mentioned, it is documented in versions.txt. See mIRC v5.7 point 100.
_________________________
Saturn, QuakeNet staff

Top
#261605 - 22/10/17 08:08 PM Re: $scriptwin alias identifier bug [Re: Sat]
Protopia Offline
Fjord artisan

Registered: 30/08/03
Posts: 226
Loc: UK
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.

Top
#261606 - 22/10/17 08:20 PM Re: $scriptwin alias identifier bug [Re: Protopia]
Sat Offline
Hoopy frood

Registered: 19/04/04
Posts: 838
Loc: The Netherlands
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

Top
#261607 - 22/10/17 08:25 PM Re: $scriptwin alias identifier bug [Re: Sat]
Protopia Offline
Fjord artisan

Registered: 30/08/03
Posts: 226
Loc: UK
@Sat - Yes, I agree.

Top
#261612 - 23/10/17 06:34 AM Re: $scriptwin alias identifier bug [Re: Protopia]
Raccoon Offline
Hoopy frood

Registered: 18/02/03
Posts: 2594
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!

Top
#261613 - 23/10/17 07:29 AM Re: $scriptwin alias identifier bug [Re: Wims]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1144
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.

Top
#261618 - 23/10/17 05:11 PM Re: $scriptwin alias identifier bug [Re: maroon]
Sat Offline
Hoopy frood

Registered: 19/04/04
Posts: 838
Loc: The Netherlands
Good points, fully agreed.
_________________________
Saturn, QuakeNet staff

Top