Help Ahk Get Text From Samp

skszikri

New member
Joined
Apr 20, 2023
Messages
3
Reaction score
0
can anyone make ahk that will type t/bla bla ( I will change it my self) When the screen appears (from dialog text) "Air support Now is avaible"

make it with ahk
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
166
Location
Poland
PHP:
Numpad0::
{
    if(RegExMatch(getChatLineEx(), "Air support Now is avaible"))
    {
        SendChat("bla bla")
    }
}
return

getChatLineEx(line := 0) 
{
    ; 0x152 - offset for first message
    ; 0xFC - size of a message
    ; 99 - max count of a messages
    if(!checkHandles())
        return
    dwPtr := dwSAMP + ADDR_SAMP_CHATMSG_PTR
    dwAddress := readDWORD(hGTA, dwPtr)
    if(ErrorLevel)
        return
    msg := readString(hGTA, dwAddress + 0x152 + ( (99-line) * 0xFC), 0xFC)
    if(ErrorLevel)
        return
    return msg
}
 
Top