on *:topic:#:{
; search topics.txt for CID+:+channelname section (actually for it to NOT be there :))
if !$read(topics.txt,w,$+([,$cid,:,#,])) {
; if not found write the "section" name, with the topic on the following line
write topics.txt $+([,$cid,:,#,],$lf,$1-)
}
; if the section was found, then only write the topic data
else write $+(-il,$calc($readn +1)) topics.txt $1-
}