Jump to content

controlgettext has a limit?


 Share

Recommended Posts

ok so i have this code, and its working.... sort of...

HotKeySet("^s", "Save")

While 1
    Sleep(100)
WEnd

Func Save()
    $text = ControlGetText("Map of Llirrem (English Province)     You're at RestartNearTown" , "" , "RichTextWndClass1")
    $Date = @YEAR & "." & @MON & "." & @MDAY
    $Time = @HOUR & "." & @MIN & "." & @SEC
    $File = FileOpen("QuestChatLog-" & $Date & "-" & $Time & ".txt", 1)
    FileWrite($File, $text & @CRLF & $Date & @CRLF)
    MsgBox(0, "Success!", "Saved log")
    FileClose($File)
EndFunc

The problem is when the file size gets more than 32 kb, it wont save the data, and all the resulting text file gets is the date. Very annoying. This is supposed to be a log for a game chat, so since the chat can get very long, how can i make it collect all the data?

If you want to re-create what i got here, go nuts. Instead of hotkeying, if the prog saved each new line to the same text file that would work too. I havnt figured out how to do that yet. But from what i can tell the controlgettext.... maybe it cant get more than 32 kb of data at a time, and if it overloads it returns nothing?

The help file doesnt say anything about a limit... and my computer is pretty beefy so its not a hardware limit... Somone please help me!

Link to comment
Share on other sites

Can you use controlcommand()

Kind of like this..

Local $line
$count =ControlCommand ("Map of Llirrem (English Province)    You're at RestartNearTown" , "" , "RichTextWndClass1","GetLineCount")

For $i = 1 to $count
$line = $line & ControlCommand ("Map of Llirrem (English Province)    You're at RestartNearTown" , "" , "RichTextWndClass1", "GetLine",$i) & @lf
Next

FileWrite ("output.txt,$line)
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...