I forgot to mention that there is also no $chan for raw 821. You should use $1 to represent $chan. Below is the working edit:
on me:*:join:#:{
msg # $read(wc.txt)
}
on me:*:part:#:{
msg # $read(part.txt)
}
raw 821:*:{
msg $1 $read(wcback.txt)
}
on *:quit:{
var %q = 1, %m
while ($comchan($nick,%q)) {
%m = $v1
if ($nick == $me) {
msg %m $read(quit.txt)
}
inc %q
}
}
raw 821 is available for most IRCX or hybrid chat servers that I've come across. For IRCD, you may need to whois and check people's away status using raw 301. To check your own away and back status, use raw 305 and 306.