CLEO Help [Cleo] Auto input dialog numbers

CLEO related

bolence13

Member
Joined
Jul 13, 2021
Messages
5
Reaction score
0
Location
SRbija
Please. I have tried everything and anything but I get this problem constantly Unknown directive alloc 0 @ 8.
 

Attachments

  • Slika.PNG
    Slika.PNG
    44.5 KB · Views: 70

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
The Code: 85316 seems to be color formatted in some way...

  1. Run this Code
  2. Make the dialog box show up
  3. post a screenshot here so that we know the color formatting
Code:
{$CLEO}
0000:

while true
    wait 0
    if 0AB1: @GetDialogCaption 0 _Returned: caption 0@
    then
        if 0AB1: @GetDialogText 0 _Returned: text 1@
        then
            if and
                0C29: 0@ = stristr string1 0@ string2 "GH - Verifikacija"
                0C29: 1@ = stristr string1 1@ string2 "Code:"
            then 0ACD: show_text_highpriority 1@ time 100
            end
        end
    end
end

:GetDialogText // credits to parazitas
// 0AB1: @GetDialogText 0 _Returned: text 1@
0AF7: samp 1@ = get_base
0A8E: 2@ = 1@ + 0x21A0B8
0A8D: 4@ = readMem 2@ sz 4 vp 0
0A8E: 5@ = 4@ + 0x28 //DialogOpenOffset
0A8D: 5@ = readMem 5@ sz 4 vp 0
if 5@ == 1 // Dialog active
then
    0A8E: 6@ = 4@ + 0x2C //DialogTypeOffset
    0A8D: 6@ = readMem 6@ sz 4 vp 0
    if or
    6@ == 0 // DIALOG_STYLE_MSGBOX
    6@ == 1 // DIALOG_STYLE_INPUT
    6@ == 3 // DIALOG_STYLE_PASSWORD
    then
        0A8E: 7@ = 4@ + 0x34 // DialogTextOffset
        0A8D: 7@ = readMem 7@ sz 4 vp 0
        0485: dialog_open
        0AB2: ret 1 7@
    end
end
059A:  dialog closed
0AB2: ret 0

:GetDialogCaption // credits to parazitas
// 0AB1: @GetDialogCaption 0 _Returned: caption 1@
0AF7: samp 1@ = get_base
0A8E: 2@ = 1@ + 0x21A0B8
0A8D: 4@ = readMem 2@ sz 4 vp 0
0A8E: 5@ = 4@ + 0x28 //DialogOpenOffset
0A8D: 5@ = readMem 5@ sz 4 vp 0
IF 5@ == 1 // Dialog open
THEN
    0A8E: 3@ = 4@ + 0x40 //DialogCaptionOffset
    0485: dialog_open
    0AB2: ret 1 3@
END
059A:  dialog closed
0AB2: ret 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
~~ Just do simple way ~~
Check for dialog exists
Get dialog caption
Compare dialog caption
Get dialog text
Delete color codes from text
Get digits from text.

PHP:
:DeleteColorCodeFromText
{
0AC8: 1@ = allocate_memory_size 1024
            0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text
}
5@ = FALSE // inbracket
0AB1: @strlen 1 string 0@ _length 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end

        if
        5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 3@ size 1 value 28@ virtual_protect 1
            3@ += 1 // move to next address
        END

        if
        003B:   28@ == 2@  // (int)
        then
            5@ = FALSE // inbracket
        end
    end
0A8C: write_memory 3@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:get_digits_to_print
{
0AC8: 1@ = allocate_memory_size 1024
                    0AB1: @get_digits_to_print param_count 2 text 0@ memory_to_store_digits_as_text 1@
}
0AB1: @strlen 1 string 0@ _return: 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if and
        28@ >= 0x30 // '0'
        28@ <= 0x39 // '9'
        then
        0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
        1@ += 1 // move to next address
        end
    end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:strlen
// 0AB1: @strlen 1 string 1@ _return: size 3@
for 1@ = 0 to 1024
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    if not 2@ == 0
    jf break
    0@ += 1
end
0AB2: ret 1 1@

Or..
Just use this source..
https://ugbase.eu/threads/types-of-sign-check-and-sources-etc.21704/
 

bolence13

Member
Joined
Jul 13, 2021
Messages
5
Reaction score
0
Location
SRbija
The Code: 85316 seems to be color formatted in some way...

  1. Run this Code
  2. Make the dialog box show up
  3. post a screenshot here so that we know the color formatting
Code:
{$CLEO}
0000:

while true
    wait 0
    if 0AB1: @GetDialogCaption 0 _Returned: caption 0@
    then
        if 0AB1: @GetDialogText 0 _Returned: text 1@
        then
            if and
                0C29: 0@ = stristr string1 0@ string2 "GH - Verifikacija"
                0C29: 1@ = stristr string1 1@ string2 "Code:"
            then 0ACD: show_text_highpriority 1@ time 100
            end
        end
    end
end

:GetDialogText // credits to parazitas
// 0AB1: @GetDialogText 0 _Returned: text 1@
0AF7: samp 1@ = get_base
0A8E: 2@ = 1@ + 0x21A0B8
0A8D: 4@ = readMem 2@ sz 4 vp 0
0A8E: 5@ = 4@ + 0x28 //DialogOpenOffset
0A8D: 5@ = readMem 5@ sz 4 vp 0
if 5@ == 1 // Dialog active
then
    0A8E: 6@ = 4@ + 0x2C //DialogTypeOffset
    0A8D: 6@ = readMem 6@ sz 4 vp 0
    if or
    6@ == 0 // DIALOG_STYLE_MSGBOX
    6@ == 1 // DIALOG_STYLE_INPUT
    6@ == 3 // DIALOG_STYLE_PASSWORD
    then
        0A8E: 7@ = 4@ + 0x34 // DialogTextOffset
        0A8D: 7@ = readMem 7@ sz 4 vp 0
        0485: dialog_open
        0AB2: ret 1 7@
    end
end
059A:  dialog closed
0AB2: ret 0

:GetDialogCaption // credits to parazitas
// 0AB1: @GetDialogCaption 0 _Returned: caption 1@
0AF7: samp 1@ = get_base
0A8E: 2@ = 1@ + 0x21A0B8
0A8D: 4@ = readMem 2@ sz 4 vp 0
0A8E: 5@ = 4@ + 0x28 //DialogOpenOffset
0A8D: 5@ = readMem 5@ sz 4 vp 0
IF 5@ == 1 // Dialog open
THEN
    0A8E: 3@ = 4@ + 0x40 //DialogCaptionOffset
    0485: dialog_open
    0AB2: ret 1 3@
END
059A:  dialog closed
0AB2: ret 0

This doesn't work!
My freezer freezes and nothing!
 
Top