Read text and do specific actions

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
aBeeThere
Posts: 1
Joined: 29 May 2023, 07:20

Read text and do specific actions

Post by aBeeThere » 30 May 2023, 03:01

Hello guyssss
I'm new to ahk and i got a problem about how to let the script read text in specific exe on screen
Here is my script:
Code:

Code: Select all

^H::
    SetKeyDelay, 60, 20
    Loop{
        SetTitleMatchMode, 2
        ControlFocus,, ahk_exe Discord.exe
        Sleep 300
        ControlSend, ,hi,ahk_exe Discord.exe
        wait(61000,61250)
    }
    wait(min, max) {
                    Random, rand, min, max
                    Sleep, rand                }
    after_loop:
return
^J::Reload
    sleep 1000
    Msgbox, 4,, Reload not working!
    return
I'm wondering if there is any way to tell the script ONLY reads the text (for example, 'hello') in discord only, then send 'hi' itself when it reads the text.
Thanks a lot if you're able to help me!!
Last edited by gregster on 30 May 2023, 03:17, edited 1 time in total.
Reason: Moved topic to AHK v1 help, since this is not v2 code. Also deleted duplicate topic in AHK_H subforum.

Return to “Ask for Help (v1)”