mIRC Home    About    Download    Register    News    Help

Print Thread
$scriptwin alias identifier bug #261597 22/10/17 12:18 PM
Joined: Aug 2003
Posts: 240
P
Protopia Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 240
I created a scriptwin alias and called it with "$scriptwin" but instead I got the results as if I had called "$script $+ win".

Re: $scriptwin alias identifier bug [Re: Protopia] #261598 22/10/17 01:22 PM
Joined: Jul 2006
Posts: 3,574
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,574
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
Re: $scriptwin alias identifier bug [Re: Wims] #261599 22/10/17 01:31 PM
Joined: Aug 2003
Posts: 240
P
Protopia Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 240
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?

Re: $scriptwin alias identifier bug [Re: Protopia] #261600 22/10/17 04:53 PM
Joined: Jan 2004
Posts: 1,200
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,200
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.

Re: $scriptwin alias identifier bug [Re: Protopia] #261601 22/10/17 05:55 PM
Joined: Jul 2006
Posts: 3,574
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,574
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
Re: $scriptwin alias identifier bug [Re: Wims] #261603 22/10/17 06:44 PM
Joined: Aug 2003
Posts: 240
P
Protopia Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 240
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.

Re: $scriptwin alias identifier bug [Re: Protopia] #261604 22/10/17 06:58 PM
Joined: Apr 2004
Posts: 841
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 841
As Wims mentioned, it is documented in versions.txt. See mIRC v5.7 point 100.


Saturn, QuakeNet staff
Re: $scriptwin alias identifier bug [Re: Sat] #261605 22/10/17 07:08 PM
Joined: Aug 2003
Posts: 240
P
Protopia Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 240
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.

Re: $scriptwin alias identifier bug [Re: Protopia] #261606 22/10/17 07:20 PM
Joined: Apr 2004
Posts: 841
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 841
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
Re: $scriptwin alias identifier bug [Re: Sat] #261607 22/10/17 07:25 PM
Joined: Aug 2003
Posts: 240
P
Protopia Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 240
@Sat - Yes, I agree.

Re: $scriptwin alias identifier bug [Re: Protopia] #261612 23/10/17 05:34 AM
Joined: Feb 2003
Posts: 2,661
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,661
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!
Re: $scriptwin alias identifier bug [Re: Wims] #261613 23/10/17 06:29 AM
Joined: Jan 2004
Posts: 1,200
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,200
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.

Re: $scriptwin alias identifier bug [Re: maroon] #261618 23/10/17 04:11 PM
Joined: Apr 2004
Posts: 841
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 841
Good points, fully agreed.


Saturn, QuakeNet staff