Requires at least Weechat 1.0 with Trigger and Exec plugin.
This gist is not intended to make [highmon.pl][1] or [any other highlight monitoring script][2] obsolete. Trigger is very limited. It can't do complex stuffs. We will only create the basic function of highlight monitoring: collect lines that contain highlight and put them all in a buffer.
First we need a trigger that will active everytime there's line printed on weechat's buffer.