just use /debug @window, put the last line of the @window in a var (set %var $line(@window,$line(@window,0))), and get a timer up which compares the last line with the var, if it's different, then execute the code you want to...