fataly Posted November 4, 2008 Share Posted November 4, 2008 this script #include <NomadMemory.au3> SetPrivilege("SeDebugPrivilege", 1) while 1 $NewMsg = DiabloGetChatMessage() If $NewMsg Then FileWrite("chat.log",$NewMsg&@CRLF) SplashTextOn("",$NewMsg,100,100,0,0) Sleep(500) EndIf wend Func DiabloGetChatMessage() Local $Handle = _MemoryOpen(WinGetProcess("Diablo II")) Local $pointer1 = _MemoryRead(0x6FBCB830, $Handle, 'dword') Local $pointer2 = _MemoryRead($pointer1, $Handle, 'dword') Local $Temp = _MemoryReadWideString($pointer2, $Handle, 'ushort[256]') _MemoryClose($Handle) Return $Temp EndFunc Works good, but its make same filewrite result after chat. so how i can get this look if same text is readed and then not filewrite it... chatlog.ini looks like this now: ÿc4Purriÿc0: ad ÿc4Purriÿc0: ad ÿc4Purriÿc0: ad ÿc4Purriÿc0: ad ÿc4Purriÿc0: ad ÿc4Purriÿc0: ad ÿc4Purriÿc0: jeps ÿc4Purriÿc0: jeps ÿc4Purriÿc0: jeps ÿc4Purriÿc0: jeps ÿc4Purriÿc0: jeps ÿc4Purriÿc0: jeps ÿc4Purriÿc0: jeps ÿc4Purriÿc0: jeps ÿc4Purriÿc0: jeps ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: this is stupid ÿc4Purriÿc0: why its repeat all so long.. ÿc4Purriÿc0: why its repeat all so long.. ÿc4Purriÿc0: why its repeat all so long.. ÿc4Purriÿc0: why its repeat all so long.. ÿc4Purriÿc0: why its repeat all so long.. ÿc4Purriÿc0: tell me:) ÿc4Purriÿc0: tell me:) ÿc4Purriÿc0: tell me:) Link to comment Share on other sites More sharing options...
SIone Posted November 4, 2008 Share Posted November 4, 2008 IF you insist on NOT searching the help files and the forum you are likely to remain stuck with your problem. Im not even going to give a lead in my reply since it appears you require some practice with trying new approaches to your problem. Please post back when you can demonstrate that you have tried another way of solving this problem... Perilous to all of us are the devices of an art deeper than we ourselves possess. Link to comment Share on other sites More sharing options...
Bert Posted November 4, 2008 Share Posted November 4, 2008 (edited) IF you insist on NOT searching the help files and the forum you are likely to remain stuck with your problem. Im not even going to give a lead in my reply since it appears you require some practice with trying new approaches to your problem. Please post back when you can demonstrate that you have tried another way of solving this problem...@SIone: You are being somewhat harsh and rude. He asked a question, and showed code that he is having issue with. That is a heck of a lot better than some. Chill out. -------------------------------------------- @fataly: what you may want to do is add a time stamp to the beginning of the string that is written. Take a look at _Date_Time_GetLocalTime. The example there will show you how to add the time stamp to the filewrite line. You don't have to have it, but for logging purposes, it helps. FileWrite("chat.log",$NewMsg&@CRLF) Once you have this set, then do a FileReadLine(""chat.log", -1) on the last line written to see if it matches $NewMsg. Hope this helps. Edited November 4, 2008 by Volly The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
fataly Posted November 4, 2008 Author Share Posted November 4, 2008 thanks:) its helped Link to comment Share on other sites More sharing options...
Bert Posted November 4, 2008 Share Posted November 4, 2008 Welcome The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
SIone Posted November 4, 2008 Share Posted November 4, 2008 @SIone:You are being somewhat harsh and rude. He asked a question, and showed code that he is having issue with. That is a heck of a lot better than some. Chill out.To fataly and Volly:Please accept my apologies.Im sorry i was harsh and rude. Perilous to all of us are the devices of an art deeper than we ourselves possess. Link to comment Share on other sites More sharing options...
Bert Posted November 4, 2008 Share Posted November 4, 2008 No problem. I see you are helping others out with some good work. Thanks! The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
TehWhale Posted November 4, 2008 Share Posted November 4, 2008 Yes when working with Diablo II, it gets the last chat message, if it has changed or not, so you need to compare the data and see if its the same. Glad you got it working. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now