[Python-Release]All Pm log

04/20/2012 22:45 pixetto#1
This is a very simple thing, maybe to be used in combination with another.I want them in a folder called "log" are written all pm that i receive.
That said, it acts in a simple, well follow the steps:

1) Create a folder "log" in the directory of the client.
2) Search:
Code:
def OnRecvWhisper
3)Replace this :
Code:
    def OnRecvWhisper(self, mode, name, line):
        if mode == chat.WHISPER_TYPE_GM:
            self.interface.RegisterGameMasterName(name)
        chat.AppendWhisper(mode, name, line)
        self.interface.RecvWhisper(name)
with my script :
Code:
def OnRecvWhisper(self, mode, name, line):
        if mode == chat.WHISPER_TYPE_GM:
            self.interface.RegisterGameMasterName(name)
        chat.AppendWhisper(mode, name, line)
        self.interface.RecvWhisper(name)
        exsta=open("log/"+name+".txt","a")
        exsta.write(line+"\n")
        exsta.close()
RESULT:

In your folder you have all of the txt file with the names of all the pg that they send you pm, and within each txt logs of conversations.


Sorry for my bad english :)
04/20/2012 22:51 Fear *_*#2
haha nice work :D
04/20/2012 22:53 xCPx#3
Quote:
def OnRecvWhisper(self, mode, name, line):
if mode == chat.WHISPER_TYPE_GM:
self.interface.RegisterGameMasterName(name)
chat.AppendWhisper(mode, name, line)
self.interface.RecvWhisper(name)
exsta=open("log/"+name+".txt","a")
exsta.write(line+"\n")
exsta.close()

i would use this code:

Code:
def OnRecvWhisper(self, mode, name, line):
		import os
		try: 
			os.chdir(os.getcwd() + "/log")
		except:
			os.mkdir(os.getcwd() + "/log")
        if mode == chat.WHISPER_TYPE_GM:
            self.interface.RegisterGameMasterName(name)
        chat.AppendWhisper(mode, name, line)
        self.interface.RecvWhisper(name)
        exsta=open("log/"+name+".txt","a")
        exsta.write(line+"\n")
        exsta.close()
then folder is created automatically on each players pc :P

but nice idea :)
04/20/2012 23:21 .Raicon#4
Hmmm. You are Exsta out of the Inf. Forum?
Because you said your script.....

Bad ENGLISH, i still know it!
04/21/2012 17:32 pixetto#5
Yes why?
04/23/2012 22:18 .Yunu#6
Thanks for the Release
04/23/2012 22:34 .aNNdii##7
[Only registered and activated users can see links. Click Here To Register...]

#closed