Would like to see a -i switch added to the ALIAS prefix to allow an alias to have priority over a built in identifier.
Currently any alias such as "alias debug { etc etc etc | return something }" can not return its own $debug value, it well always return the true debug window, since (as said in the help) "Built-in identifiers of the same name have priority."
I would like a switch to be able to override them. (dont want it to be the default action as that likely well cause other scripts to fail)
$Debug is one i have a need for, I want to maintain my debug window with my alias being run on each line, while also allowing someone elses script to appear to be able to do a /debug command, which my script can handle as a sub component of its own, obviuosly I would prefer to be able to, if something asked for the $debug identifier be able to return the window that the other persons script set as the debug window. So you can setup a fully transparent handling layer. (PS I have managed to get around this one actually).
Another example might be with the potential problem with long and short filenames on the /DLL command being talked about in the bugs forum, such an alias as follows could exist that would adjust the filename internally to a longfilename and call/load the dll as needed.
(Please note : roughly scripted so im ignoring spaces in filenames, error checking etc, its just an example to the idea)
alias -i dll {
if (!isid) { dll $longfn($1) $2- }
else { return $dll($longfn($1),$2,$3) }
}
alias -i dllcall {
if (isid) { return $dllcall($longfn($1),$2,$3,$4) }
}
Im unsure on the reason In built identifiers take priority, I can see the ability to override internal identifiers open to be used to abuse unsuspecting people, but in the same moment i see it as a great debugging aid also, such as being able to debug a ON *:TEXT:*:* { event } by setting the identifiers as needed and calling it as an alias (here i used /testme)
;on *:TEXT:*:*:{
alias testme {
if ($chan == #blah) || ($chan == %secondchannel) {
...
if ($chan == #blah) && ($nick == Bob) { ... }
if ($chan == %secondchannel) && ($nick == Bill) { ... }
....
}
}
alias -i chan { return #blah }
;alias -i chan { return #wombat }
;alias -i nick { return Bob }
alias -i nick { return Bill }
^ by simply remarking out the unwanted settings of chan and nick you can test the event as if its on a live channel(s) being set off by what ever nick is needed etc.