Your first code snippet won't work, $chr(119) is indistinguishable from "w" in scripts. When mirc compares the two characters for equality, it has no idea (ie it has 'forgotten') where that "w" came from, ie whether it came from $chr(119) or a hardcoded "w" or anything else.