ok, for the code you made, it needs to be:
on ^*:TEXT:*:#:{
echo -t $chan $+ $cnick($nick).color $+ $nick $+ > $1-
haltdef
}
the "-t" parameter is to add a timestamp, if you would like, you can take it out.
If you want it to work for you, you need to use on input.
on *:INPUT:#: {
echo -t $chan $+ $cnick($nick).color $+ $nick $+ > $1-
haltdef
}