Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 0.59 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   1 #!/usr/bin/env python
  2.   2
  3.   3 __module_name__ = "DictBot"
  4.   4 __module_version__ = "0.1"
  5.   5 __module_description__ = "DictBot by Muneeb"
  6.   6
  7.   7 import xchat
  8.   8 import os
  9.   9
  10.  10
  11.  11 print "\0034",__module_name__, __module_version__,"has been loaded\003"
  12.  12
  13.  13 def getDefinition(word, word_eol, userdata):
  14.  14     if word[0] == 'define':
  15.  15         cmd = 'dict %s' % (word[1])
  16.  16         fi, fo, fe = os.popen3(cmd)
  17.  17         for i in fo.readlines():
  18.  18             print i,
  19.  19
  20.  20     return xchat.EAT_ALL
  21.  21
  22.  22 xchat.hook_command('define', getDefinition, help="Usage: /define word")