Created
March 30, 2015 17:47
-
-
Save AwwCookies/bd68d0c1ca9216dc09ba to your computer and use it in GitHub Desktop.
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 xchat | |
import os | |
__module_author__ = 'Lunatrius' | |
__module_name__ = 'HighlightLog' | |
__module_version__ = '0.1' | |
__module_description__ = 'Logs highlights to a window, per-server basis.' | |
def catch_highlight(word, word_eol, userdata): | |
nickname = word[0] | |
message = word[1] | |
pingChannel = '!pings' | |
server = xchat.get_info('server') | |
channel = xchat.get_info('channel') | |
highlighttab = xchat.find_context(server=server, channel=pingChannel) | |
if not highlighttab: | |
xchat.command('query -nofocus ' + pingChannel) | |
highlighttab = xchat.find_context(server=server, channel=pingChannel) | |
if highlighttab: | |
highlighttab.command('clear') | |
if highlighttab: | |
highlighttab.emit_print('Channel Message', nickname, '[%s] %s' % (channel, message), '') | |
# os.system("notify-send 'HexChat' '%s: [%s] %s'" % (nickname, channel, message)) | |
xchat.command("gui msgbox \"%s: [%s] %s\"" % (nickname, channel, message)) | |
return xchat.EAT_NONE | |
xchat.hook_print('Channel Msg Hilight', catch_highlight) | |
xchat.hook_print('Channel Action Hilight', catch_highlight) | |
xchat.prnt('Loaded %s v%s by %s.' % (__module_name__, __module_version__, __module_author__)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment