Skip to content

Instantly share code, notes, and snippets.

@HarHar
Created May 31, 2013 03:40
Show Gist options
  • Save HarHar/5682820 to your computer and use it in GitHub Desktop.
Save HarHar/5682820 to your computer and use it in GitHub Desktop.
Mass highlighting script for Weechat
import weechat
from time import sleep
# -*- coding: utf8 -*-
weechat.register("masshighlight", "HarHar", "1.0", "GPL3", "fgt", "", "")
hook = weechat.hook_command('mhilight', 'Mass Highlight', "", "", "msg", "mh", "")
weechat.prnt("", "Mass highlighting lock and loaded")
def mh(data, buffer, args):
buffer = weechat.current_buffer()
nicks = weechat.infolist_get('nicklist', buffer, '')
_nicks = []
while weechat.infolist_next(nicks):
n = weechat.infolist_string(nicks, 'name')
if (n == 'root') or (n.find('00') == 0): continue
_nicks.append(n)
weechat.infolist_free(nicks)
splitin = 340
whole = ' '.join(_nicks)
i = 0
while i < len(whole):
weechat.command(buffer, whole[i:i+splitin])
i += splitin
sleep(1)
return weechat.WEECHAT_RC_OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment