mIRC Homepage
Posted By: FroggieDaFrog $isalias().AsNative - 05/03/16 07:16 PM
As far as I know, there's no way to determine if a command/identifier exists regardless of it being native or scripted. This makes it hard to polyfill newly added features for older client versions(yes, people should update but lets be honest: they don't).

I suggest adding a .AsNative property to the $isalias() identifier which would return $true if the specified command/identifer is supported natively regardless if there is a scripted override.
Posted By: FroggieDaFrog Re: $isalias().AsNative - 06/03/16 10:30 AM
A use-case would be poly-filling the up-and-coming $unsafe identifier:
Code:
alias myUnsafe {

  ;; if mIRC supports the 'unsafe' identifier
  if ($isalias(unsafe).AsNative) {
    return $unsafe($1-)
  }

  ;; otherwise, use a scripted equivalent. 
  elseif (!$lock(encode)) {
    return $!decode( $+ $encode($1-,m) $+ ,m)
  }
  elseif ($~prop == undo) {
    !return $~regsubex($~1-, /\\([\da-f]{2})/gi, $~chr($~base(\t, 16, 10)))
  }
  else {
    var %regex = /((?:[#,()\\])|(?:(?<= |^)[%$])|(?:(?<= |^)[\Q{}[]|\E](?= |$)))/g
    if ($regsubex($1,%regex,\ $+ $~base($~asc(\t),10,16,2)) !=== $~1) {
      return $!myUnsafe( $+ $v1 $+ ).undo
    }
    !return $~1-
  }
}
© mIRC Discussion Forums