Try this. Taken from Vincula but modified for your purpose.
on *:START:{
window @knock
}
raw KNOCK:*: {
if ($2 == 913) echo @knock * Knock: $asctime $msn.ifdecode($nick) ( $+ $address $+ ) (Access Ban): $nick
elseif ($2 == 471) echo @knock * Knock: $asctime $msn.ifdecode($nick) ( $+ $address $+ ) (Room is full): $nick
elseif ($2 == 473) echo @knock * Knock: $asctime $msn.ifdecode($nick) ( $+ $address $+ ) (Room is invite only): $nick
elseif ($2 == 474) echo @knock * Knock: $asctime $msn.ifdecode($nick) ( $+ $address $+ ) (Banned): $nick
elseif ($2 == 475) echo @knock * Knock: $asctime $msn.ifdecode($nick) ( $+ $address $+ ) (Need room key): $nick
else echo @knock * Knock: $asctime $msn.ifdecode($nick) ( $+ $address $+ ) (Numeric: $2 $+ ): $nick
haltdef
}

Edited Jun 25, 2004 2:45 AM by Mail
"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers
menu * {
-
Knock Logger
.Turn On Knock Logger:.enable #logknock
.Turn Off Knock Logger:.disable #logknock
.-
.View Log File:run knocklog.dat
#logknock on
raw KNOCK:*: {
write knocklog.dat [ $+ $date $+ ][ $+ $asctime $+ ] Knock $2 = $msn.decode($nick) = $address = $replace($2,913,access ban,471,room full,473,room is invite only,474,banned,475,room key needed)
haltdef
}
#logknock end
This is the same thing as the one above, except it has the ability to be turned off/on, and writes it to a text file so that you can keep a good track of all knocks.
Edited Jun 25, 2004 1:12 PM by The Gate Keeper
Thanks Mail & GateKeeper for your replies...

Edit: * /run: unable to open 'knocklog.dat'
Edited Jun 26, 2004 2:33 AM by MucH
GateKeeper the problem is that it named the knock.dat file as knocklog.dat$date][$asctimeKnock That might be part of the problem in which it wouldnt open
write $+(",Remote\,knock.dat") $2 $1
Might be the solution i've been looking for.
Edit: Nope not working either
Edited Jun 26, 2004 7:45 PM by MucH
Try this code.
menu * {
-
Knock Logger
.Turn On Knock Logger:{ if (!$exists($findfile($mircdir,knocklog.dat,1))) { write knocklog.dat <Knocks Logged Here> | enable #logknock }
}
.Turn Off Knock Logger:.disable #logknock
.-
.View Log File { run knocklog.dat }
#logknock on
raw KNOCK:*: {
write knocklog.dat $chr(32) $+ [ $+ $date $+ ] $chr(32) $+ [ $+ $asctime $+ ] $chr(32) $+ Knock $2 = $msn.decode($nick) = $address = $replace($2,913,access ban,471,room full,473,room is invite only,474,banned,475,room key needed)
haltdef
}
#logknock end
This way if the file "knocklog.dat" doesn't exist it will create it.
Edited Jun 27, 2004 3:42 PM by Warrior124