I don't see a bug in mIRC here, only a bug in your implementation.

0 is not a valid dialog ID and therefore, unsurprisingly, cannot be accessed via $did. This behavior itself is not a bug, but it seems like your complaint is specific to the raising of an error vs. quietly returning $null. In this case, raising an error is not very different from returning $null-- it might keep your script from a hard-fail, but more than likely, if you're doing anything substantial with the output from $did(), your script will still break if it gets back a $null. Consider an example where you're looking up the contents of $did($did).text as a hash table key-- that would break.

In general, this should not affect scripts, since most of the time you're targeting specific IDs in your event matcher. If you're matching an ID range of *, it's your script's responsibilty to guard against invalid IDs. It's as easy as doing:

Code:
ON *:DIALOG:test:*:* {
  if ($did == 0) return
  ; the rest of your script
}


The above code makes the implementation work correctly.

More than likely you'll want to guard against other IDs, since you probably still have a set of "static" elements that should not trigger events (you wouldn't want to look up the $did().text of an arbitrary static label as a hash table key), so this is not even specific to 0. The better way to do this is not to use * unless you're debugging. Target specific actions using individual IDs.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"