Jump to content

Little help ask, just need halp:)


fataly
 Share

Recommended Posts

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

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

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 by Volly
Link to comment
Share on other sites

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...