jacob614

!echo (doesn't work?)

Dec 22nd, 2012
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1.     import hexchat
  2.     # Experimental xchat plugin - after editing
  3.     #  place in C:\Program Files\HexChat\scripts\
  4.     #  and call with "/py load scripts/<name>.py"
  5.     # Variables
  6.     __module_name__ = "Echo plugin"
  7.     __module_version__ = "1.0"
  8.     __module_description__ = "Works with !echo derp"
  9.     # Main hook control
  10.     def printhook_test(word, word_eol, userdata):
  11.             text = word[1].split() # On print hooks, word = ["username", "all the text"]
  12.             # print (text, word)
  13.             if text[0] == "!echo" and len(text) > 1: # If starts with my command and it's longer than 1
  14.                     echotext = ""
  15.                     for i in text[1:]: ## Join them with spaces!
  16.                             echotext = echotext + i + " "
  17.                     hexchat.command("say "+ echotext) # +" --> "+ word[0])
  18.     #Hooks
  19.     hexchat.hook_print("Channel Message", printhook_test)
  20.     hexchat.hook_print("Channel Msg Hilight", printhook_test)
  21.     # hookC = xchat.hook_print("Your Message", printhook_test)
  22.     print ("*** Loaded echo plugin.")
  23.     # if hookC is None:
  24.     #       print ("*** Self referencing is OFF.")
  25.     # else:
  26.     #       print ("*** Self referencing is ON.")
Advertisement
Add Comment
Please, Sign In to add comment