Types of Sign Check and Sources , etc...

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
My respects.

What I need is that when this dialog appears, the cancel button is chosen automatically.

Honors.

Please help me.
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AA2: 30@ = "samp.dll"

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ = format "Sign check"

0AB1: @get_samp_version_id 0 _Returned: ID 1@

WHILE TRUE
WAIT 0

IF
0256:   player $PLAYER_CHAR defined
THEN
    IF
    0AB1: @isDialogOpen 1 SampVersionID 1@
    THEN
        IF
        0AB1: @GetDialogCaption 1 SampVersionID 1@ _Return: caption 2@
        THEN
            0AC8: 3@ = allocate_memory_size 260
            0AB1: @DeleteColorCodeFromText 4 text 2@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 3@
            IF
            0AB1: @IfTextContains 2 String1 3@ String2 4@ _returned: Text 5@
            THEN
                0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 1@ Button 1 // 1 = Left , 0 = Right
            END
        END
    END
END

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:isDialogOpen
// 0AB1: @isDialogOpen 1 SampVersionID 0@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN      
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN      
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN      
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN      
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN      
    0A8E: 2@ = 1@ + 0x26E9C8
END
0A8D: 2@ = readMem 2@ sz 4 vp 0
0A8E: 2@ = 2@ + 0x28
0A8D: 2@ = readMem 2@ sz 4 vp 0
IF 2@ == 1
THEN
    0485: dialog_open
ELSE
    059A: dialog_closed
END
0AB2: ret 0

:GetDialogCaption
// 0AB1: @GetDialogCaption 1 SampVersionID 0@ _Returned: caption 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN      
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN      
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN      
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN      
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN      
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
ELSE
    059A:  dialog closed
END
0AB2: ret 0

:GetDialogText
// 0AB1: @GetDialogText 1 SampVersionID 0@ _Returned: text 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN      
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN      
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN      
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN      
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN      
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
    else 059A:  dialog closed
    end
end
0AB2: ret 0

:CloseCurrentDialogWithButton
// 0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 0@ Button 1 // 1 = Left , 0 = Right
IF 0AA2: 10@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C040 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C0F0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6FF40 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x70660 //SAMP_DIALOG_CLOSE
    END

    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 1@ _retVal 6@
END
0AB2: 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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

: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@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
It's sercure password. What I need is that when this dialog appears, it will choose 4 digits i have set and then click ">> Hoan thanh" @Parazitas
well i can't do this , i don't know how get dialog list item text, but maybe i find way.
 
Last edited:

bye

Active member
Joined
Sep 15, 2013
Messages
57
Reaction score
0
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AA2: 30@ = "samp.dll"

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ = format "Sign check"

0AB1: @get_samp_version_id 0 _Returned: ID 1@

WHILE TRUE
WAIT 0

IF
0256:   player $PLAYER_CHAR defined
THEN
    IF
    0AB1: @isDialogOpen 1 SampVersionID 1@
    THEN
        IF
        0AB1: @GetDialogCaption 1 SampVersionID 1@ _Return: caption 2@
        THEN
            0AC8: 3@ = allocate_memory_size 260
            0AB1: @DeleteColorCodeFromText 4 text 2@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 3@
            IF
            0AB1: @IfTextContains 2 String1 3@ String2 4@ _returned: Text 5@
            THEN
                0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 1@ Button 1 // 1 = Left , 0 = Right
            END
        END
    END
END

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:isDialogOpen
// 0AB1: @isDialogOpen 1 SampVersionID 0@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN
    0A8E: 2@ = 1@ + 0x26E9C8
END
0A8D: 2@ = readMem 2@ sz 4 vp 0
0A8E: 2@ = 2@ + 0x28
0A8D: 2@ = readMem 2@ sz 4 vp 0
IF 2@ == 1
THEN
    0485: dialog_open
ELSE
    059A: dialog_closed
END
0AB2: ret 0

:GetDialogCaption
// 0AB1: @GetDialogCaption 1 SampVersionID 0@ _Returned: caption 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
ELSE
    059A:  dialog closed
END
0AB2: ret 0

:GetDialogText
// 0AB1: @GetDialogText 1 SampVersionID 0@ _Returned: text 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
    else 059A:  dialog closed
    end
end
0AB2: ret 0

:CloseCurrentDialogWithButton
// 0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 0@ Button 1 // 1 = Left , 0 = Right
IF 0AA2: 10@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C040 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C0F0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6FF40 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x70660 //SAMP_DIALOG_CLOSE
    END

    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 1@ _retVal 6@
END
0AB2: 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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

: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@

Thanks for helping me.
Some problems here, I can't login. remember i need this cleo to only works when the dialog box i told you is displayed.

I am using sampfuncsV 5.3.1
Cleo V 4.3

Samp V 0.3.7
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Thanks for helping me.
Some problems here, I can't login. remember i need this cleo to only works when the dialog box i told you is displayed.

I am using sampfuncsV 5.3.1
Cleo V 4.3

Samp V 0.3.7

PHP:
{$CLEO .cs}

0000:

Wait 8500

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ = format "My dialog caption"

WHILE TRUE
WAIT 0

IF
0256:   player $PLAYER_CHAR defined
THEN
0AB1: @get_samp_version_id 0 _Returned: ID 1@
    IF
    0AB1: @isDialogOpen 1 SampVersionID 1@
    THEN
        IF
        0AB1: @GetDialogCaption 1 SampVersionID 1@ _Return: caption 2@
        THEN
            0AC8: 3@ = allocate_memory_size 260
            0AB1: @DeleteColorCodeFromText 4 text 2@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 3@
            IF
            0AB1: @IfTextContains 2 String1 3@ String2 4@ _returned: Text 5@
            THEN
                0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 1@ Button 1 // 1 = Left , 0 = Right
            END
        END
    END
END

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:isDialogOpen
// 0AB1: @isDialogOpen 1 SampVersionID 0@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN    
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN    
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN    
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN    
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN    
    0A8E: 2@ = 1@ + 0x26E9C8
END
0A8D: 2@ = readMem 2@ sz 4 vp 0
0A8E: 2@ = 2@ + 0x28
0A8D: 2@ = readMem 2@ sz 4 vp 0
IF 2@ == 1
THEN
    0485: dialog_open
ELSE
    059A: dialog_closed
END
0AB2: ret 0

:GetDialogCaption
// 0AB1: @GetDialogCaption 1 SampVersionID 0@ _Returned: caption 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN    
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN    
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN    
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN    
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN    
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
ELSE
    059A:  dialog closed
END
0AB2: ret 0

:GetDialogText
// 0AB1: @GetDialogText 1 SampVersionID 0@ _Returned: text 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN    
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN    
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN    
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN    
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN    
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
    else 059A:  dialog closed
    end
end
0AB2: ret 0

:CloseCurrentDialogWithButton
// 0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 0@ Button 1 // 1 = Left , 0 = Right
IF 0AA2: 10@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C040 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C0F0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6FF40 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x70660 //SAMP_DIALOG_CLOSE
    END

    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 1@ _retVal 6@
END
0AB2: 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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

: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@
 
  • Like
Reactions: bye

bye

Active member
Joined
Sep 15, 2013
Messages
57
Reaction score
0
PHP:
{$CLEO .cs}

0000:

Wait 8500

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ = format "My dialog caption"

WHILE TRUE
WAIT 0

IF
0256:   player $PLAYER_CHAR defined
THEN
0AB1: @get_samp_version_id 0 _Returned: ID 1@
    IF
    0AB1: @isDialogOpen 1 SampVersionID 1@
    THEN
        IF
        0AB1: @GetDialogCaption 1 SampVersionID 1@ _Return: caption 2@
        THEN
            0AC8: 3@ = allocate_memory_size 260
            0AB1: @DeleteColorCodeFromText 4 text 2@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 3@
            IF
            0AB1: @IfTextContains 2 String1 3@ String2 4@ _returned: Text 5@
            THEN
                0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 1@ Button 1 // 1 = Left , 0 = Right
            END
        END
    END
END

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:isDialogOpen
// 0AB1: @isDialogOpen 1 SampVersionID 0@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN
    0A8E: 2@ = 1@ + 0x26E9C8
END
0A8D: 2@ = readMem 2@ sz 4 vp 0
0A8E: 2@ = 2@ + 0x28
0A8D: 2@ = readMem 2@ sz 4 vp 0
IF 2@ == 1
THEN
    0485: dialog_open
ELSE
    059A: dialog_closed
END
0AB2: ret 0

:GetDialogCaption
// 0AB1: @GetDialogCaption 1 SampVersionID 0@ _Returned: caption 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
ELSE
    059A:  dialog closed
END
0AB2: ret 0

:GetDialogText
// 0AB1: @GetDialogText 1 SampVersionID 0@ _Returned: text 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
    else 059A:  dialog closed
    end
end
0AB2: ret 0

:CloseCurrentDialogWithButton
// 0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 0@ Button 1 // 1 = Left , 0 = Right
IF 0AA2: 10@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C040 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C0F0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6FF40 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x70660 //SAMP_DIALOG_CLOSE
    END

    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 1@ _retVal 6@
END
0AB2: 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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

: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@

Thank you very much for your support.

H O N O R S.

P E R F E C T.

T H A N K S.
 
Last edited:

chargedpanda

Member
Joined
Jun 12, 2020
Messages
7
Reaction score
0
Location
Turkey
...
Sign Check - Chat 2

Source samp 0.3.7 R*- 0.3.DL:
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @get_samp_version_id 0 _Returned: ID 0@
    for 30@ = 95 to 99
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 30@  _Returned: text 1@
        0AC8: 2@ = allocate_memory_size 260
        0AB1: @DeleteColorCodeFromText 4 text 1@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 2@
        0AC8: 3@ = allocate_memory_size 260
        0AD3: 3@ = "/signcheck"   // Check / find text
        if
        0AB1: @IfTextContains 2 String1 2@ String2 3@ _returned: text 4@
        then
            0AC8: 6@ = allocate_memory_size 260
            0AB1: @get_digits_to_print param_count 2 text 2@ memory_to_store_digits_as_text 6@
            0AC8: 5@ = allocate_memory_size 260
            0AD3: 5@ "/signcheck %s" 6@   // CMD
            0AB1: @SEND_CMD 2 SampVersionID 0@ text 5@
            wait 10000 // anti spam
        end
    end
end

end

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:GetChatEntryText
{
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 99  _Returned: text 1@
}
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN 
        0A8E: 3@ = 2@ + 0x21A0E4
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN 
        0A8E: 3@ = 2@ + 0x21A0EC
    END

    IF 0@ == 3 // 0.3.DL
    THEN 
        0A8E: 3@ = 2@ + 0x2ACA10
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN  
        0A8E: 3@ = 2@ + 0x26E8C8
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN 
        0A8E: 3@ = 2@ + 0x26E9F8
    END
    0A8D: 2@ readMem 3@ sz 4 vp 0
    2@ += 0x132
    1@ *= 0xFC
    005A: 2@ += 1@
    2@ += 0x20
    0AA3: 2@
END
0AB2: ret 1 2@

:IfTextContains
{
    0@ - the main text
    1@ - piece of text to be found within the main text
}
0AB1: @strlen 1 strPtr 0@ _length 31@
0AB1: @strlen 1 strPtr 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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@ _return: 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
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}
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
{
    Example: 0AB1: @strlen 1 string 1@ _return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
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@

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN 
        0A8E: 3@ = 2@ + 0x65C60
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN 
        0A8E: 3@ = 2@ + 0x65D30
    END

    IF 0@ == 3 // 0.3.DL
    THEN 
        0A8E: 3@ = 2@ + 0x69340
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN  
        0A8E: 3@ = 2@ + 0x69190
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN 
        0A8E: 3@ = 2@ + 0x698C0
    END
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0

...

This only getting digits (@get_digits_to_print param_count). Is there anyway to get with chars?(Example: UGB84) I need for version 0.3DL
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.DL
Maybe works idk xD

PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AC8: 3@ = allocate_memory_size 260
0AD3: 3@ = "AFK Control!" // Check / find text

0AC8: 5@ = allocate_memory_size 260
0AD3: 5@ = "'/afk" // Check / find text

0AC8: 8@ = allocate_memory_size 260
0AD3: 8@ = "' before" // Check / find text

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 ChatLineID 99 _Returned: text 1@ // 99 last chat line
    0AC8: 2@ = allocate_memory_size 260
    0AB1: @DeleteColorCodeFromText 4 text 1@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 2@ // remove color codes and return clean string
    if
    0AB1: @IfTextContains 2 String1 2@ String2 3@ _returned: text 4@  // find text and compare to make sure is that what we need
    then
        if
        0AB1: @IfTextContains 2 String1 2@ String2 5@ _returned: text 6@  // find text " '/afk code"
        then
            0AB1: @strlen 1 strPtr 6@ _length 7@ // GET RETURNED TEXT SIZE
            if
            0AB1: @IfTextContains 2 String1 6@ String2 8@ _returned: text 9@  // find end of text " '/afk code"
            then
                0AB1: @strlen 1 strPtr 9@ _length 10@ // GET RETURNED TEXT SIZE
                0062: 7@ -= 10@ // DELETE FROM 7@ SIZE, 10@ - RETURNED TEXT SIZE , NOW YOU KNOW THE SIZE OF TEXT WHICH YOU NEED DELETE FROM 6@ RETURNED STRING
                0AB1: @strncpy 3 destination 6@ source 6@ size 7@ // COPY STRING WITH NEW SIZE OF TEXT
                0AB1: @SkipFirstCharacters 2 String 6@ Characters 6 rnt 11@ // '/afk = 5 CHARACTERS + ONE CHARACTER FOR SPACE, WHICH MEANS WE SKIP 6 CHARACTERS AND FINALLY TEXT IS - UG84
                0AC8: 12@ = allocate_memory_size 260
                0AD3: 12@ "/afk %s" 11@
                0AB1: @SEND_CMD 1 text 12@
                wait 10000 // anti spam
            end
        end
    end
end

end

:getChatEntryText
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x2ACA10
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

:IfTextContains
{
    0@ - the main text
    1@ - piece of text to be found within the main text
}
0AB1: @strlen 1 strPtr 0@ _length 31@
0AB1: @strlen 1 strPtr 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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@ _return: 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

:strncpy
var
0@ : integer
1@ : integer
2@ : integer
30@ : integer
31@ : integer
end

// 0@ - destination, 1@ - source, 2@ - size
// Example: 0AB1: @strncpy 3 destination 0@ source 1@ size 2@

30@ = 0
31@ = 1
while 31@ <> 0
    0A8D: 31@ = read_memory 1@ size 1 virtual_protect 0
    0A8C: write_memory 0@ size 1 value 31@ virtual_protect 0
    30@++ // count
    0@++ // dst
    1@++ // src
    if 30@ == 2@
    then BREAK
    end
end
0A8C: write_memory 0@ size 1 value 0 virtual_protect 0 // null terminate
0AB2: ret 0

:strlen
{
    Example: 0AB1: @strlen 1 string 1@ _return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
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@

:SkipFirstCharacters
005A: 0@ += 1@
0AB2: ret 1 0@

:SEND_CMD
//0AB1: @SEND_CMD 1 $text
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x69340 // FUNC_SEND_CMD_03DL
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0
 
Last edited:

Amralime

New member
Joined
Apr 28, 2021
Messages
2
Reaction score
0
Location
Vietnam
Sign Check - Dialog

Source samp 0.3.7 R*- 0.3.DL:
PHP:
{$CLEO .cs}

0000:

wait 8500

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ = format "Sign check"

WHILE TRUE
WAIT 0

IF
0256:   player $PLAYER_CHAR defined
THEN
    0AB1: @get_samp_version_id 0 _Returned: ID 1@
    IF
    0AB1: @isDialogOpen 1 SampVersionID 1@
    THEN
        IF
        0AB1: @GetDialogCaption 1 SampVersionID 1@ _Return: caption 2@
        THEN
            0AC8: 3@ = allocate_memory_size 260
            0AB1: @DeleteColorCodeFromText 4 text 2@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 3@
            IF
            0AB1: @IfTextContains 2 String1 3@ String2 4@ _returned: Text 5@
            THEN
                IF
                0AB1: @GetDialogText 1 SampVersionID 1@ _Returned: text 6@
                THEN
                    0AC8: 7@ = allocate_memory_size 260
                    0AB1: @DeleteColorCodeFromText 4 text 6@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 7@
                    0AC8: 8@ = allocate_memory_size 260
                    0AB1: @get_digits_to_print param_count 2 text 7@ memory_to_store_digits_as_text 8@
                    0AB1: @SetDialogInputEditBoxText 2 SampVersionID 1@ text 8@
                    0209: 9@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
                    wait 9@ // normal people can't react instant , so that why we need add timer
                    0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 1@ Button 1 // 1 = Left , 0 = Right
                END
            END
        END
    END
END

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:isDialogOpen
// 0AB1: @isDialogOpen 1 SampVersionID 0@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN     
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN     
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN     
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN     
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN     
    0A8E: 2@ = 1@ + 0x26E9C8
END
0A8D: 2@ = readMem 2@ sz 4 vp 0
0A8E: 2@ = 2@ + 0x28
0A8D: 2@ = readMem 2@ sz 4 vp 0
IF 2@ == 1
THEN
    0485: dialog_open
ELSE
    059A: dialog_closed
END
0AB2: ret 0

:GetDialogCaption
// 0AB1: @GetDialogCaption 1 SampVersionID 0@ _Returned: caption 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN     
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN     
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN     
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN     
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN     
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
ELSE
    059A:  dialog closed
END
0AB2: ret 0

:GetDialogText
// 0AB1: @GetDialogText 1 SampVersionID 0@ _Returned: text 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN     
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN     
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN     
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN     
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN     
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
    else 059A:  dialog closed
    end
end
0AB2: ret 0


:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}
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

:SetDialogInputEditBoxText
// 0AB1: @SetDialogInputEditBoxText 2 SampVersionID 0@ text 1@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 3@ = 2@ + 0x21A0B8            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x80F60 // CDXUTEditBox::SetText
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
         0A8E: 3@ = 2@ + 0x21A0C0            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x81000 // CDXUTEditBox::SetText
    END

    IF 0@ == 3 // 0.3.DL
    THEN     
        0A8E: 3@ = 2@ + 0x2AC9E0            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x85000 // CDXUTEditBox::SetText
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 3@ = 2@ + 0x26E898            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x84E70 // CDXUTEditBox::SetText
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 3@ = 2@ + 0x26E9C8            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x855B0 // CDXUTEditBox::SetText
    END
    // CDXUTEditBox::SetText takes 2 params
    // 1 - pointer to zero terminated string
    // 2 - bool, if text is to be selected or not

    0AA8: call_function_method 5@ struct 4@ num_params 2 pop 0 _bSelected 0 _pszText 1@ _retVal 6@
END
0AB2: 0

:CloseCurrentDialogWithButton
// 0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 0@ Button 1 // 1 = Left , 0 = Right
IF 0AA2: 10@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C040 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C0F0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6FF40 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x70660 //SAMP_DIALOG_CLOSE
    END

    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 1@ _retVal 6@
END
0AB2: 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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

: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@


Sign Check - Chat

Source samp 0.3.7 R*- 0.3.DL:
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AC8: 3@ = allocate_memory_size 260
0AD3: 3@ = "Type /signcheck"   // Check / find text

0AC8: 5@ = allocate_memory_size 260
0AD3: 5@ "/signcheck"   // CMD

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @get_samp_version_id 0 _Returned: ID 0@
    for 30@ = 95 to 99
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 30@  _Returned: text 1@
        0AC8: 2@ = allocate_memory_size 260
        0AB1: @DeleteColorCodeFromText 4 text 1@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 2@
        if  
        0AB1: @IfTextContains 2 String1 2@ String2 3@ _returned: text 4@
        then
            0AB1: @SEND_CMD 2 SampVersionID 0@ text 5@
            wait 10000 // anti spam
        end
    end
end

end

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:GetChatEntryText
{
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 99  _Returned: text 1@
}
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN     
        0A8E: 3@ = 2@ + 0x21A0E4
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN     
        0A8E: 3@ = 2@ + 0x21A0EC
    END

    IF 0@ == 3 // 0.3.DL
    THEN     
        0A8E: 3@ = 2@ + 0x2ACA10
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN      
        0A8E: 3@ = 2@ + 0x26E8C8
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN     
        0A8E: 3@ = 2@ + 0x26E9F8
    END
    0A8D: 2@ readMem 3@ sz 4 vp 0
    2@ += 0x132
    1@ *= 0xFC
    005A: 2@ += 1@
    2@ += 0x20
    0AA3: 2@
END
0AB2: ret 1 2@

:IfTextContains
{
    0@ - the main text
    1@ - piece of text to be found within the main text
}
0AB1: @strlen 1 strPtr 0@ _length 31@
0AB1: @strlen 1 strPtr 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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@ _return: 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

:strlen
{
    Example: 0AB1: @strlen 1 string 1@ _return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
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@

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN     
        0A8E: 3@ = 2@ + 0x65C60
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN     
        0A8E: 3@ = 2@ + 0x65D30
    END

    IF 0@ == 3 // 0.3.DL
    THEN     
        0A8E: 3@ = 2@ + 0x69340
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN      
        0A8E: 3@ = 2@ + 0x69190
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN     
        0A8E: 3@ = 2@ + 0x698C0
    END
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0


Sign Check - Chat 2

Source samp 0.3.7 R*- 0.3.DL:
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @get_samp_version_id 0 _Returned: ID 0@
    for 30@ = 95 to 99
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 30@  _Returned: text 1@
        0AC8: 2@ = allocate_memory_size 260
        0AB1: @DeleteColorCodeFromText 4 text 1@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 2@
        0AC8: 3@ = allocate_memory_size 260
        0AD3: 3@ = "/signcheck"   // Check / find text
        if  
        0AB1: @IfTextContains 2 String1 2@ String2 3@ _returned: text 4@
        then
            0AC8: 6@ = allocate_memory_size 260
            0AB1: @get_digits_to_print param_count 2 text 2@ memory_to_store_digits_as_text 6@
            0AC8: 5@ = allocate_memory_size 260
            0AD3: 5@ "/signcheck %s" 6@   // CMD
            0AB1: @SEND_CMD 2 SampVersionID 0@ text 5@
            wait 10000 // anti spam
        end
    end
end

end

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:GetChatEntryText
{
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 99  _Returned: text 1@
}
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN     
        0A8E: 3@ = 2@ + 0x21A0E4
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN     
        0A8E: 3@ = 2@ + 0x21A0EC
    END

    IF 0@ == 3 // 0.3.DL
    THEN     
        0A8E: 3@ = 2@ + 0x2ACA10
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN      
        0A8E: 3@ = 2@ + 0x26E8C8
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN     
        0A8E: 3@ = 2@ + 0x26E9F8
    END
    0A8D: 2@ readMem 3@ sz 4 vp 0
    2@ += 0x132
    1@ *= 0xFC
    005A: 2@ += 1@
    2@ += 0x20
    0AA3: 2@
END
0AB2: ret 1 2@

:IfTextContains
{
    0@ - the main text
    1@ - piece of text to be found within the main text
}
0AB1: @strlen 1 strPtr 0@ _length 31@
0AB1: @strlen 1 strPtr 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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@ _return: 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
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}
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
{
    Example: 0AB1: @strlen 1 string 1@ _return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
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@

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN     
        0A8E: 3@ = 2@ + 0x65C60
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN     
        0A8E: 3@ = 2@ + 0x65D30
    END

    IF 0@ == 3 // 0.3.DL
    THEN     
        0A8E: 3@ = 2@ + 0x69340
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN      
        0A8E: 3@ = 2@ + 0x69190
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN     
        0A8E: 3@ = 2@ + 0x698C0
    END
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0


Etc...

PHP:
{$CLEO .cs}

0000:

wait 8500

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ = format "Drug Production"

WHILE TRUE
WAIT 0

IF
0256:   player $PLAYER_CHAR defined
THEN
    0AB1: @get_samp_version_id 0 _Returned: ID 1@
    IF
    0AB1: @isDialogOpen 1 SampVersionID 1@
    THEN
        IF
        0AB1: @GetDialogCaption 1 SampVersionID 1@ _Return: caption 2@
        THEN
            0AC8: 3@ = allocate_memory_size 260
            0AB1: @DeleteColorCodeFromText 4 text 2@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 3@
            IF
            0AB1: @IfTextContains 2 String1 3@ String2 4@ _returned: Text 5@
            THEN
                IF
                0AB1: @GetDialogText 1 SampVersionID 1@ _Returned: text 6@
                THEN
                    0AC8: 7@ = allocate_memory_size 260
                    0AB1: @DeleteColorCodeFromText 4 text 6@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 7@
                    0AB1: @GetLastCharacters 2 String 7@ Characters 11 rnt 8@
                    0AB1: @SetDialogInputEditBoxText 2 SampVersionID 1@ text 8@
                    0209: 9@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
                    wait 9@ // normal people can't react instant , so that why we need add timer
                    0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 1@ Button 1 // 1 = Left , 0 = Right
                END
            END
        END
    END
END

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:isDialogOpen
// 0AB1: @isDialogOpen 1 SampVersionID 0@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN       
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN       
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN       
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN       
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN       
    0A8E: 2@ = 1@ + 0x26E9C8
END
0A8D: 2@ = readMem 2@ sz 4 vp 0
0A8E: 2@ = 2@ + 0x28
0A8D: 2@ = readMem 2@ sz 4 vp 0
IF 2@ == 1
THEN
    0485: dialog_open
ELSE
    059A: dialog_closed
END
0AB2: ret 0

:GetDialogCaption
// 0AB1: @GetDialogCaption 1 SampVersionID 0@ _Returned: caption 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN       
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN       
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN       
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN       
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN       
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
ELSE
    059A:  dialog closed
END
0AB2: ret 0

:GetDialogText
// 0AB1: @GetDialogText 1 SampVersionID 0@ _Returned: text 1@
0AA2: 1@ = "samp.dll"
IF 0@ == 1 // 0.3.7 R1
THEN       
    0A8E: 2@ = 1@ + 0x21A0B8
END
IF 0@ == 2 // 0.3.7 R2
THEN       
    0A8E: 2@ = 1@ + 0x21A0C0
END

IF 0@ == 3 // 0.3.DL
THEN       
    0A8E: 2@ = 1@ + 0x2AC9E0
END

IF 0@ == 4 // 0.3.7 R3
THEN       
    0A8E: 2@ = 1@ + 0x26E898
END

IF 0@ == 5 // 0.3.7 R4
THEN       
    0A8E: 2@ = 1@ + 0x26E9C8
END
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@
    else 059A:  dialog closed
    end
end
0AB2: ret 0


:SetDialogInputEditBoxText
// 0AB1: @SetDialogInputEditBoxText 2 SampVersionID 0@ text 1@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 3@ = 2@ + 0x21A0B8            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x80F60 // CDXUTEditBox::SetText
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
         0A8E: 3@ = 2@ + 0x21A0C0            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x81000 // CDXUTEditBox::SetText
    END

    IF 0@ == 3 // 0.3.DL
    THEN       
        0A8E: 3@ = 2@ + 0x2AC9E0            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x85000 // CDXUTEditBox::SetText
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 3@ = 2@ + 0x26E898            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x84E70 // CDXUTEditBox::SetText
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 3@ = 2@ + 0x26E9C8            // SAMP_DIALOG_INFO_OFFSET
        0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
        0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
        0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;

        0A8E: 5@ = 2@ + 0x855B0 // CDXUTEditBox::SetText
    END
    // CDXUTEditBox::SetText takes 2 params
    // 1 - pointer to zero terminated string
    // 2 - bool, if text is to be selected or not

    0AA8: call_function_method 5@ struct 4@ num_params 2 pop 0 _bSelected 0 _pszText 1@ _retVal 6@
END
0AB2: 0

:CloseCurrentDialogWithButton
// 0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 0@ Button 1 // 1 = Left , 0 = Right
IF 0AA2: 10@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C040 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6C0F0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x6FF40 //SAMP_DIALOG_CLOSE
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
        0A8D: 12@ = readMem 11@ sz 4 vp 0
        0A8E: 11@ = 10@ + 0x70660 //SAMP_DIALOG_CLOSE
    END

    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 1@ _retVal 6@
END
0AB2: 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end
end

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  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

:GetLastCharacters
{
    0AB1: @GetLastCharacters 2 String 0@ Characters 5 rnt 1@
}
0AB1: @strlen 1 String 0@ Lenght 2@
0062: 2@ -= 1@
005A: 0@ += 2@
0AB2: ret 1 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@


! Make Sure you have right settings !

Help me pls @Parazitas the signcheck dialog doesn't work for me. It crash when i open samp
 

Wgamer

Active member
Joined
Mar 10, 2017
Messages
71
Reaction score
18
Yo homie paracitas og I wanna use this to make like a WTLS anti afk method of /activity around every half an hour I just want a way to make it so it auto /activities and reads hte numbers I'll try to make do with the copy paste thanks a ton really just any way to do it in like idk a while loop propably is what I'm looking for else I'll try to hook it on a AHK script that does it every so often thanks tho a ton I'll experement soon with it.
 

Wgamer

Active member
Joined
Mar 10, 2017
Messages
71
Reaction score
18
parazitas I'm hot garbage and forgot I'll have to also distinguish between colors
 

Attachments

  • Screenshot_3.png
    Screenshot_3.png
    20.9 KB · Views: 41
Top