mIRC Homepage
Posted By: Knoeki $scriptline bug - 21/01/10 03:03 PM
I'm suspecting there might be a bug in the identifier $scriptline.

It seems that, instead of working exclusively as '$scriptline', it also seems to work with.. well.. whatever you stick behind it. '$scriptlines25439' will still return the currently executing line in the script.

I'm not entirely sure if this is actually a bug, for all I know it might be a feature, and if it is, I appologize, but would also like to know the reason it works like this.

EDIT: Someone found out you're apparently not even allowed to start alias names with the word 'script' to begin with, although I haven't personally confirmed this.
Posted By: Khaled Re: $scriptline bug - 21/01/10 03:18 PM
There are quite a few identifiers that behave that way. This is a legacy behaviour left over from when the parser was first designed. I have avoided fixing the behaviour for specific identifiers in case it breaks existing scripts, however newer identifiers are more strict.
Posted By: Horstl Re: $scriptline bug - 21/01/10 03:41 PM
For example, while text appended to $scriptline will be ignored, text appended to the $N-identifiers will be used. This means aliases mustn't start with a number...
Unless you use: $/<identifier> (the /-prefix enforces the usage of the custom identifier) or $.<identifier>. This in turn means your aliases mustn't be named like prefixes: "/" "//" "/." or "." And of course they mustn't start with a "!". There's also "~" (this prefix prevents the "no such identifier" message - for default identifiers only). smile
However, aliases starting with the word "script" do work.

Code:
alias scripttest { echo -a $!scriptlineABC: $scriptlineABC $!1ABC: $1ABC }
/scripttest test
Posted By: Wims Re: $scriptline bug - 21/01/10 04:13 PM
Quote:
There's also "~" (this prefix prevents the "no such identifier" message - for default identifiers only)
It's a side effect of what $~ really do : calling the builtin mIRC identifier or return $null
Posted By: Knoeki Re: $scriptline bug - 21/01/10 04:42 PM
Thanks for the replies, it cleared up the issue for me :_)
© mIRC Discussion Forums