## init stuff __module_name__ = "PyQuote" __module_version__ = "really unstable" __module_description__ = "made for kuht.it" import xchat,random ## configuration stuff channel = "#Kuht" quotefile = "c:/documents and settings/viper/desktop/quote.data.py" ## engine qfile = open(quotefile,'r+') def givequote(): xchat.command('msg ' + channel + ' [QUOTE] ' + str(random.choice(qfile.readlines())).strip()) qfile.seek(0) def addquote(string,nick): noop = qfile.readlines() qfile.write(string + "\n") qfile.seek(0) xchat.command('notice ' + nick + ' Quote Addato! [python quoting system by viper]') def getdata(word,word_eol,userdata): if word[2] == channel: if word[3] == ":!quote": givequote() return xchat.EAT_NONE elif word[3] == ":!addquote": addquote(word_eol[4],word[0][:word.find("!")]) return xchat.EAT_NONE else: return xchat.EAT_NONE else: return xchat.EAT_NONE ## runtime xchat.hook_server("PRIVMSG", getdata)