Autohotkey: Scrape text from window (LOTRO)

4k views Asked by At

I am fairly advanced with my LOTRO scripting, but sadly, have not figured out a way to capture data from the chatbox. I am trying to write an external mapping application and would like to have autohotkey automatically grab data from the screen, particularly the location data that has the heading, by typing:

/loc

inside of the chat box.

This image is linked to imgur with the areas I am trying to capture highlighted.

I find it very odd as I can highlight the text in the window easily, and copy and paste it to notepad or any other wordpad editor.

I have tried to following methods to attempt to gather the text from the window, but I cannot seem to find any controls or text, even when running the script as administrator.

WinGet, cList, ControlList, A
Loop, Parse, cList, `n, `r
{
  ControlGetText, cText, % A_LoopField, A
  if cText
    res.="Control: " A_LoopField "`tText: " cText "`n"
}
MsgBox % res

WinGetText, text  ; The window found above will be used.
MsgBox, The text is:`n%text%

Any ideas?

1

There are 1 answers

2
vasili111 On BEST ANSWER

Games have non conventional GUIs and you can't just get there controls and use them.

For getting information from screen for nonconventional GUIs you can use following commands: ImageSearch, PixelGetColor, PixelSearch.

You can also try to get information from registry (maybe information that you need is stored in registry) with RegRead command.

Some information can be stored in text files and you can read them with FileRead, FileReadLine, LoopReadFile.

Also you can try to get information from memory. For scripts and guides about reading memory with AutoHotkey just google "AutoHotkey read memory".

Also be aware of that.