[SNIPPET] Get Dialog Text

Explain.:
PHP:
{$CLEO .cs}

0000: NOP

wait 10000

while true
wait 0

if
0AB1: @isDialogOpen 1 ID -1 // -1 any
then         
    0AC8: 0@ = allocate_memory_size 512   
    0AB1: @getDialogText 0 0@
end

end

:isDialogOpen
{
    0.3.7 - R3
}
0AA2: 1@ = "samp.dll"
1@ += 0x26E898
0A8D: 1@ = readMem 1@ sz 4 vp 0
0A8E: 2@ = 1@ + 0x28
0A8D: 2@ = readMem 2@ sz 4 vp 0
if 2@ == 1 // Dialog active
then
    0A8E: 3@ = 1@ + 0x30 //dialogTypeOffset
    0A8D: 3@ = readMem 3@ sz 4 vp 0
    if 0@ == -1 // Any dialog
    then
        0485: dialog_open
    else
        if  
        003B:   3@ == 0@
        then
            0485: dialog_open
        else
            059A:  dialog_closed
        end
    end
end
0AB2: ret 0

:GetDialogText
{
    0.3.7 - R3
}
0AA2: 1@ = "samp.dll"
1@ += 0x26E898
0A8D: 1@ = readMem 1@ sz 4 vp 0
0A8E: 2@ = 1@ + 0x28 //DialogOpenOffset
0A8D: 2@ = readMem 2@ sz 4 vp 0
if 2@ == 1 // Dialog active
then
    0A8E: 3@ = 1@ + 0x2C //DialogTypeOffset
    0A8D: 3@ = readMem 3@ sz 4 vp 0
    if or
    3@ == 0 // DIALOG_STYLE_MSGBOX 
    3@ == 1 // DIALOG_STYLE_INPUT
    3@ == 3 // DIALOG_STYLE_PASSWORD
    then 
        0A8E: 4@ = 1@ + 0x34 // DialogTextOffset
        0A8D: 4@ = readMem 4@ sz 4 vp 0 
        0485: dialog_open
        0AB2: ret 1 4@
    else 059A:  dialog closed
    end
end
0AB2: ret 0

Snippets
PHP:
:GetDialogText
{
    0.3.7 - R3
}
0AA2: 1@ = "samp.dll"
1@ += 0x26E898
0A8D: 1@ = readMem 1@ sz 4 vp 0
0A8E: 2@ = 1@ + 0x28 //DialogOpenOffset
0A8D: 2@ = readMem 2@ sz 4 vp 0
if 2@ == 1 // Dialog active
then
    0A8E: 3@ = 1@ + 0x2C //DialogTypeOffset
    0A8D: 3@ = readMem 3@ sz 4 vp 0
    if or
    3@ == 0 // DIALOG_STYLE_MSGBOX 
    3@ == 1 // DIALOG_STYLE_INPUT
    3@ == 3 // DIALOG_STYLE_PASSWORD
    then 
        0A8E: 4@ = 1@ + 0x34 // DialogTextOffset
        0A8D: 4@ = readMem 4@ sz 4 vp 0 
        0485: dialog_open
        0AB2: ret 1 4@
    else 059A:  dialog closed
    end
end
0AB2: ret 0
 
Last edited:

0x1E4

Member
Joined
Jan 2, 2019
Messages
13
Reaction score
2
Please gimme some examples how to use, it will be grateful for me.

Its like:
PHP:
{$CLEO .cs}

0000: NOP

wait 10000

while true
wait 0

IF
call @isChatOpen 0
THEN
    CALL @SAMP_GET_CHAT_INPUT_TEXT 0 0@
    CHATMSG "checkedtext" -1 0@
END

END

:SAMP_GET_CHAT_INPUT_TEXT
0AA2: 1@ = "samp.dll"
1@ += 0x12D8F8
0A8D: 1@ = readMem 1@ sz 260 vp 0
0AB2: 1 1@

:isChatOpen
0AA2: 1@ = "samp.dll"
1@ += 0x21A0E8
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x14E0
0A8D: 1@ = readMem 1@ sz 4 vp 0
if 1@ <> 0
then
    0485: chat_open
else
    059A: chat_closed
end
0AB2: ret 0

or what?
 
Top