import weechat weechat.register('count_lines', 'FlashCode', '0.1', 'GPL3', 'Count lines in core buffer', '', '') buf = weechat.buffer_search('core', 'weechat') hdata_buf = weechat.hdata_get('buffer') hdata_lines = weechat.hdata_get('lines') lines = weechat.hdata_pointer(hdata_buf, buf, 'lines') count = weechat.hdata_integer(hdata_lines, lines, 'lines_count') weechat.prnt('', 'number of lines in core buffer: %d' % count)