Created
May 31, 2013 03:40
-
-
Save HarHar/5682820 to your computer and use it in GitHub Desktop.
Mass highlighting script for Weechat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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