Sign in to follow this  
Followers 0
The_Noob

controlgettext has a limit?

5 posts in this topic

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!

Share this post


Link to post
Share on other sites



Ok so theres like 32000 char limit on it... Any way to get past that?

Is there a way to make it log like the last 5 lines? Has anyone been able to find a way around this?

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

ok that works awsome... slow, but no limit that i can tell

thanks!

Share this post


Link to post
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
Sign in to follow this  
Followers 0