I think its a misunderstanding.
Yes, you can specify a range of tokens (N-N)
e.g. $gettok(a.b.c.d.e,2-4,46) will return 2nd to 4th token (counted from left, as there is a positive value for N): b.c.d
You can also specify a negative value vor N in $gettok(text,N,C). mIRC will then count the "starting" token not from left, but right.
e.g. $gettok(a.b.c.d.e,-1,46) will return the "first right" token (which is in fact always the last token) : e
To get the last 3 tokens, you can use a range of "third (right) to first (right)" which is: -3 - -1
e.g. $gettok(a.b.c.d.e,-3--1,46) will return (as it should): c.d.e
So far, so good.
What you did, is using a positive AND negative value for N. mIRC dont likes that (I dont know why
I guess the reason is that mIRC would have to count twice: left AND right).
I'm not sure whether your "$gettok(a.b.c.d.e,2--1,46)" is intended to get "2nd to 2nd-last" token or "2nd to last". If I'm right, you wanted to get "second (counted from left) to first (counted from right) token", that is 2nd to last, that is $gettok(a.b.c.d.e,2-,46) .
Whatever, mIRC dislikes this, and ignores the whole "--1" in $gettok(a.b.c.d.e,2--1,46) as it would ignore "--" in $gettok(a.b.c.d.e,2--,46) or "--nothing" in $gettok(a.b.c.d.e,2--nothing,46) .
If you intend - on the other hand side - to stop at the 2nd-last token, get "b.c.d" counting either
from left: $gettok(a.b.c.d.e,2-4,46)
or
from right: $gettok(a.b.c.d.e,-4--2,46)
Or, If you dont know what number of tokens "text" in fact contains, count them first using $numtok(text,C) or $gettok(text,0,C) .
e.g. to get "2nd to 2nd-last out of a unknown number of tokens":
var %2nd.last = $calc($numtok(text,C) -1)
gettok(text,2- %2nd.last,C)
Hope I could help a little, or at least confused you not even more...