Advertisement
nucular

(He)XChat greentext script

May 20th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. __module_name__ = "greentexter"
  2. __module_version__ = "0.1"
  3. __module_description__ = "Colours each message starting with a > green"
  4.  
  5. import xchat
  6.  
  7. COLOR = "3"
  8.  
  9. def greentext(word, word_eol, userdata):
  10.     text = word_eol[0]
  11.     ctx = xchat.get_context()
  12.  
  13.     server = ctx.get_info("server")
  14.     channel = ctx.get_info("channel")
  15.     nick = xchat.get_info("nick")
  16.  
  17.     if text.strip()[0] == ">":
  18.         text = "\3" + COLOR + text
  19.  
  20.     xchat.command("PRIVMSG %s :%s" % (channel, text))
  21.     xchat.emit_print("Your Message", nick, text)
  22.     return xchat.EAT_ALL
  23.  
  24. xchat.hook_command("", greentext)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement