[ create a new paste ] login | about

Link: http://codepad.org/VTLG15xA    [ raw code | output | fork ]

Python, pasted on Dec 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python
import xchat

__module_name__ = "mushwars Triggers"
__module_version__ = "0.1.3-beta"
__module_description__ = "/notice $nick my list of triggers and how to use them."

def message_cb(word, word_eol, userdata):
      message=word[1]
      if message == "!help":
	xchat.command("notice "+word[0]+" !google <STRING> ~ !time (CST only) ~ !define <TERM> (google define)") 
	xchat.command("notice "+word[0]+" !calc <SIMPLE EXPRESSION> ~ !weather <ZIPCODE> ~ !tvrage <TV SHOW> (includes anime)")
      else:
          True

xchat.hook_print("Channel Message", message_cb) 
xchat.hook_print("Your Message", message_cb)  


Output:
1
2
3
4
Traceback (most recent call last):
  Line 2, in <module>
    import xchat
ImportError: No module named xchat


Create a new paste based on this one


Comments: