Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hexchat
- # Experimental xchat plugin - after editing
- # place in C:\Program Files\HexChat\scripts\
- # and call with "/py load scripts/<name>.py"
- # Variables
- __module_name__ = "Echo plugin"
- __module_version__ = "1.0"
- __module_description__ = "Works with !echo derp"
- # Main hook control
- def printhook_test(word, word_eol, userdata):
- text = word[1].split() # On print hooks, word = ["username", "all the text"]
- # print (text, word)
- if text[0] == "!echo" and len(text) > 1: # If starts with my command and it's longer than 1
- echotext = ""
- for i in text[1:]: ## Join them with spaces!
- echotext = echotext + i + " "
- hexchat.command("say "+ echotext) # +" --> "+ word[0])
- #Hooks
- hexchat.hook_print("Channel Message", printhook_test)
- hexchat.hook_print("Channel Msg Hilight", printhook_test)
- # hookC = xchat.hook_print("Your Message", printhook_test)
- print ("*** Loaded echo plugin.")
- # if hookC is None:
- # print ("*** Self referencing is OFF.")
- # else:
- # print ("*** Self referencing is ON.")
Advertisement
Add Comment
Please, Sign In to add comment