Greetings!
I'm currently working on multiple small projects. One of them is a chat room bot that listens to commands and returns different kinds of results.
The way it's capturing text now is by using "GetTextAtPoint". The biggest inconvenient at the moment is that I have to keep the chat window visible at all times and it has to keep the same position and size.
My query's the following: is there a more convenient way of retrieving chat text from a minimized (unfocused) window. I am aware that you can't give me a clear example fitting exactly my situation, but please try to imagine the scenario and provide me with example code that could put me on the right track, so I can then come back and ask about more specific issues.
Thank you.
Retrieving text from a minimized window
Moderators: Dorian (MJT support), JRL
JRL just told me about SetControlText in a different topic and I didn't think of checking GetControlText. *sigh*
Thank you, adroege! It works retrieving text from the main chat box. It gets all the text, and the last line is a blank one.
Could you show me how to store the line before the blank one to a variable? (i.e. [23:03:52] test5)
Thank you, adroege! It works retrieving text from the main chat box. It gets all the text, and the last line is a blank one.
Code: Select all
[...]
[23:03:45] <bot1> test1
[23:03:47] <bot1> test2
[23:03:49] <bot1> test3
[23:03:50] <bot1> test4
[23:03:52] <bot1> test5
[blank line here]
This should help you out
Code: Select all
//You are doing something like this already
//GetControlText>WindowTitle,ClassName,Instance,Result
//I'm simulating getcontroltext by just putting the output in a "result" variable
Let>result=[23:03:45] <bot1> test1%CRLF%[23:03:47] <bot1> test2%CRLF%[23:03:49] <bot1> test3%CRLF%[23:03:50] <bot1> test4%CRLF%[23:03:52] <bot1> test5%CRLF%
//This separates the text into lines
Separate>result,%CRLF%,items
//You may need to adjust this to items_6
MessageModal>items_5