Types of Sign Check and Sources , etc...

Cole_Sp

Member
Joined
Feb 13, 2022
Messages
20
Reaction score
2
Location
Maz
PHP:
{$CLEO}
{$USE bitwise}
0000:

WHILE TRUE
WAIT 0

IF AND
0AB0:   key_pressed 18 {ALT}
0AB0:   key_pressed 49 {1}
THEN
    0B12: 30@ = 30@ XOR 1       
    IF 0039:   30@ == TRUE
    THEN 0AD1: show_formatted_text_highpriority "~w~Auto Signcheck ~g~Activated" time 1337
    ELSE 0AD1: show_formatted_text_highpriority "~w~Auto Signcheck ~r~Deactivated" time 137   
    END
    WAIT 137
END

IF 30@ == TRUE
THEN
    IF 0256:   player $PLAYER_CHAR defined
    THEN
        FOR 0@ = 95 to 99
            0AC8: 1@ = allocate_memory_size 1024
            0AC8: 2@ = allocate_memory_size 1024
            0AB1: @getChatString 2 SampVersionID 1 ChatID 0@ _Returned: Text 1@ PrefixText 2@ Color 3@ PrefixColor 4@   
            0AC8: 5@ = allocate_memory_size 1024
            0AB1: @DeleteColorCodeFromText 2 text 1@ memory_to_store_characters_as_text 5@
            0AC8: 6@ = allocate_memory_size 1024
            0AD3: 6@ = "/signcheck"
            IF 0AB1: @IfTextContains 2 String1 5@ String2 6@ _Returned: Text 7@
            THEN       
                0AC8: 8@ = allocate_memory_size 1024
                0AB1: @get_digits_to_print param_count 2 text 5@ memory_to_store_digits_as_text 8@              
                0AC8: 9@ = allocate_memory_size 1024
                0AD3: 9@ = "/signcheck %s" 8@
                0AD1: show_formatted_text_highpriority "~w~INFO: ~r~/signcheck %s" time 1337 8@
                0209: 10@ = random_int_in_ranges 1000 2000
                WAIT 10@
                0AB1: @ProcessChatInput 2 SampVersionID 1 InputText 9@
                0AC9: free_allocated_memory 9@
                WAIT 10000
                // Payday! Type '/signcheck 6284' to collect your paycheck!
            END
        END
    END
END

END
 
:getChatString
{
    0AC8: 1@ = allocate_memory_size 1024
    0AC8: 2@ = allocate_memory_size 1024
    0AB1: @getChatString 2 SampVersionID 0@ ChatID 99 _Returned: Text 1@ PrefixText 2@ Color 3@ PrefixColor 4@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            31@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 3 // 0.3.DL
        THEN
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 4 // 0.3.7 R3
        THEN
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 5 // 0.3.7 R4
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
    
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

:ProcessChatInput
{
    0AB1: @ProcessChatInput 2 SampVersionID 0@ InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN   
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 21@ = 20@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
          
            0A8E: 24@ = 20@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x65D30 // PROCESS_INPUT 
        END
   
        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 21@ = 20@ + 0x21A0F0            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
          
            0A8E: 24@ = 20@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x65E00 // PROCESS_INPUT
        END
   
        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 21@ = 20@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
          
            0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT  
        END
   
        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 21@ = 20@ + 0x26E8CC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
          
            0A8E: 24@ = 20@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69260 // PROCESS_INPUT
        END
   
        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 21@ = 20@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
          
            0A8E: 24@ = 20@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69990 // PROCESS_INPUT
        END
       
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 21@ = 20@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
          
            0A8E: 24@ = 20@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x699D0 // PROCESS_INPUT
        END
        0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 1@ _retVal 6@
        0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
    END
END
0AB2: 0

:DeleteColorCodeFromText
{
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @DeleteColorCodeFromText 2 text 0@ memory_to_store_characters_as_text 1@
}
//*********************** Strlen *********************\\
0085: 27@ = 0@ // copy pointer
FOR 31@ = 0 TO 1024
    0A8D: 26@ = read_memory 27@ size 1 virtual_protect 0
    IF NOT 26@ == 0
    JF BREAK
    27@ += 1
END  
//****************************************************\\
5@ = FALSE // inbracket
    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 28@ == 123
        THEN 5@ = TRUE // inbracket begin
        END
      
        IF 5@ == FALSE // not inbracket
        THEN
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        END
      
        IF 28@ == 125
        THEN 5@ = FALSE // inbracket end
        END
    END
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
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

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

: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
works perfectly <3
 

Krauser

Member
Joined
Mar 18, 2020
Messages
7
Reaction score
0
Location
Tunisia
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

while true
wait 0

if 0256:   player $PLAYER_CHAR defined
then
    0AB1: @get_samp_version_id 0 _Returned: ID 0@
    for 1@ = 95 to 99
        0AC8: 2@ = allocate_memory_size 1024
        0AC8: 3@ = allocate_memory_size 1024
        0AB1: @getChatString 2 SampVersionID 0@ ChatID 1@ _Returned: Text 2@ PrefixText 3@ Color 4@ PrefixColor 5@
        0AC8: 6@ = allocate_memory_size 1024
        0AB1: @DeleteColorCodeFromText 4 text 2@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 6@
        0AC8: 7@ = allocate_memory_size 1024
        0AD3: 7@ = "Type /signcheck"   // Check / find text
        if 0AB1: @IfTextContains 2 String1 6@ String2 7@ _returned: text 8@
        then
            0AC8: 9@ = allocate_memory_size 1024
            0AD3: 9@ "/signcheck"   // CMD
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 9@
            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@

:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 2 SampVersionID 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN  
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN  
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
 
        IF 0@ == 3 // 0.3.DL
        THEN  
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
 
        IF 0@ == 4 // 0.3.7 R3
        THEN   
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
 
        IF 0@ == 5 // 0.3.7 R4
        THEN  
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

: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 NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN     
            0A8E: 3@ = 2@ + 0x65C60
            0AA5: call 3@ num_param 1 pop 0 1@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN     
            0A8E: 3@ = 2@ + 0x65D30
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 3 // 0.3.DL
        THEN     
            0A8E: 3@ = 2@ + 0x69340
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 4 // 0.3.7 R3
        THEN      
            0A8E: 3@ = 2@ + 0x69190
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 5 // 0.3.7 R4
        THEN     
            0A8E: 3@ = 2@ + 0x698C0
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    END
END
0AB2: 0
I'm using both scripts. The server consists of writing /signcheck then responding to the dialog. The dialog script is working fine but the /signcheck text script is crashing my game for unknown reasons. I have sampfuncs 5.5.0 and SAMP R-3. Please help me fixing this.
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
Create a new thread on ugbase forum and when i have time then i will help you, probably already i solved your problem
 

aPELAobr

Active member
Joined
Jan 13, 2015
Messages
185
Reaction score
0
1657484118511.png

I need a cleo/asi/lua mod to detect this text draw that basically request to flood press 'Y' to fish.. If you could at least make a 'macro mod' that auto flood 'y' when i hold some key would be awesome too
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
Create new topics and we will help you guys!
 

afkkirito

New member
Joined
Dec 5, 2020
Messages
4
Reaction score
1
Location
Bratsk, Russia
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

while true
wait 0

if 0256:   player $PLAYER_CHAR defined
then
    0AB1: @get_samp_version_id 0 _Returned: ID 0@
    for 1@ = 95 to 99
        0AC8: 2@ = allocate_memory_size 1024
        0AC8: 3@ = allocate_memory_size 1024
        0AB1: @getChatString 2 SampVersionID 0@ ChatID 1@ _Returned: Text 2@ PrefixText 3@ Color 4@ PrefixColor 5@
        0AC8: 6@ = allocate_memory_size 1024
        0AB1: @DeleteColorCodeFromText 4 text 2@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 6@
        0AC8: 7@ = allocate_memory_size 1024
        0AD3: 7@ = "Type /signcheck"   // Check / find text
        if 0AB1: @IfTextContains 2 String1 6@ String2 7@ _returned: text 8@
        then
            0AC8: 9@ = allocate_memory_size 1024
            0AD3: 9@ "/signcheck"   // CMD
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 9@
            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@

:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 2 SampVersionID 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN  
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN  
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
 
        IF 0@ == 3 // 0.3.DL
        THEN  
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
 
        IF 0@ == 4 // 0.3.7 R3
        THEN   
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
 
        IF 0@ == 5 // 0.3.7 R4
        THEN  
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

: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 NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN     
            0A8E: 3@ = 2@ + 0x65C60
            0AA5: call 3@ num_param 1 pop 0 1@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN     
            0A8E: 3@ = 2@ + 0x65D30
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 3 // 0.3.DL
        THEN     
            0A8E: 3@ = 2@ + 0x69340
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 4 // 0.3.7 R3
        THEN      
            0A8E: 3@ = 2@ + 0x69190
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 5 // 0.3.7 R4
        THEN     
            0A8E: 3@ = 2@ + 0x698C0
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    END
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 !
Sir, how about the firstone, if i type /paycheck then it will auto signcheck how do i modify that. from /signcheck to /paycheck thanks..
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Sir, how about the firstone, if i type /paycheck then it will auto signcheck how do i modify that. from /signcheck to /paycheck thanks..
Please provide picture from your chat message which has /paycheck
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland

Script_debug.cs
PHP:
{$CLEO .cs}
{$USE bitwise}
0000:

WHILE TRUE
WAIT 0

IF 0ADC:   test_cheat "1" 
THEN
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "{fba200}_________________________________________________________"
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "{ffffff}Information on paychecks: {33c9fc}/payhelp {ffffff}or {33c9fc}/taxhelp"
    0AC8: 2@ = allocate_memory_size 1024
    0AD3: 2@ = format "{97ca31}_________________________________________________________"
    0AC8: 3@ = allocate_memory_size 1024
    0AD3: 3@ = format "{ffffff}Sign the check to receive your paycheck."
    0AC8: 4@ = allocate_memory_size 1024
    0AD3: 4@ = format "{33c9fc}Receive your salary by typing (/paycheck)"
    0AC8: 5@ = allocate_memory_size 1024
    0AD3: 5@ = format "{ffffff}You have 5 minutes to sign the check before it becomes invalid."
    0AC8: 6@ = allocate_memory_size 1024
    0AD3: 6@ = format "{fba200}_________________________________________________________"    
    0AB1: @Chatmsg 3 SampVersionID 1 text 0@ color -1
    0AB1: @Chatmsg 3 SampVersionID 1 text 1@ color -1
    0AB1: @Chatmsg 3 SampVersionID 1 text 2@ color -1
    0AB1: @Chatmsg 3 SampVersionID 1 text 3@ color -1
    0AB1: @Chatmsg 3 SampVersionID 1 text 4@ color -1
    0AB1: @Chatmsg 3 SampVersionID 1 text 5@ color -1
    0AB1: @Chatmsg 3 SampVersionID 1 text 6@ color -1
END

IF 0ADC:   test_cheat "2" 
THEN
    FOR 7@ = 0 TO 15
        0AC8: 8@ = allocate_memory_size 1024
        0AD3: 8@ = format ""    
        0AB1: @Chatmsg 3 SampVersionID 1 text 8@ color -1
    END
END

IF 0ADC:   test_cheat "3" 
THEN
    0AC8: 9@ = allocate_memory_size 1024
    0AD3: 9@ = format "Pay Check"
    0AC8: 10@ = allocate_memory_size 1024
    0AD3: 10@ = format "Your Paycheck Number: 709668%c%cEnter your paycheck number to receive your paycheck:" 0xA 0xA
    0AC8: 11@ = allocate_memory_size 1024
    0AD3: 11@ = format "Pay Check"
    0AC8: 12@ = allocate_memory_size 1024
    0AD3: 12@ = format "Cancel"
    0AB1: @ShowDialog 6 id 1000 caption 9@ text 10@ button_1 11@ button_2 12@ style 1
END

END
0A93: terminate_this_custom_script

Script.cs <<< check this, Numpad1 to enable
PHP:
{$CLEO .cs}
{$USE bitwise}
0000:

WHILE TRUE
WAIT 0

IF 0AB0:   is_key_pressed 97 // Numpad 1
THEN
    0B12: 31@ = 31@ XOR 1        
    IF 0039:   31@ == 1
    THEN 0AD1: show_formatted_text_highpriority "~g~on" time 1000
    ELSE 0AD1: show_formatted_text_highpriority "~r~off" time 1000   
    END
    WAIT 1000
END

IF 31@ == 1
THEN
    FOR 0@ = 97 TO 99
        0AC8: 1@ = allocate_memory_size 1024
        0AC8: 2@ = allocate_memory_size 1024
        0AB1: @getChatString 2 SampVersionID 1 ChatID 0@ _Returned: Text 1@ PrefixText 2@ Color 3@ PrefixColor 4@
        0AC8: 5@ = allocate_memory_size 1024
        0AB1: @DeleteColorCodesFromText 2 text 1@ memory_to_store_characters_as_text 5@
        0AC8: 6@ = allocate_memory_size 1024
        0AD3: 6@ = format "Receive your salary by typing (/paycheck)"        
        IF 0AB1: @IfTextContains 2 String1 5@ String2 6@ _Returned: Text $NOT_USED
        THEN
            0AC8: 7@ = allocate_memory_size 1024
            0AD3: 7@ = format "/paycheck"        
            0AB1: @ProcessChatInput 2 SampVersionID 1 InputText 7@
            WAIT 2000
        END    
    END
    IF 0AB1: @isDialogOpen 1 SampVersionID 1
    THEN
        0AB1: @GetDialogCaption 1 SampVersionID 1 _Returned: caption 8@
        0AC8: 9@ = allocate_memory_size 1024
        0AB1: @DeleteColorCodesFromText 2 text 8@ memory_to_store_characters_as_text 9@
        0AC8: 10@ = allocate_memory_size 1024
        0AD3: 10@ = format "Pay Check"        
        IF 0AB1: @IfTextContains 2 String1 9@ String2 10@ _Returned: Text $NOT_USED
        THEN
            IF 0AB1: @GetDialogText 1 SampVersionID 1 _Returned: text 11@
            THEN
                0AC8: 12@ = allocate_memory_size 1024
                0AB1: @DeleteColorCodesFromText 2 text 11@ memory_to_store_characters_as_text 12@
                0AC8: 13@ = allocate_memory_size 1024
                0AB1: @get_digits_to_print 2 text 12@ memory_to_store_digits_as_text 13@
                0AB1: @SetDialogInputEditBoxText 2 SampVersionID 1 text 13@
                0209: 14@ = random_int_in_ranges 1000 2000
                WAIT 14@
                0AB1: @CloseCurrentDialogWithButton 2 SampVersionID 1 Button 1 // 1 = Left , 0 = Right
                WAIT 15000
            END            
        END                
    END
END

END
0A93: terminate_this_custom_script
 

Attachments

  • Script.cs
    43 KB · Views: 12
  • Script_debug.cs
    23.6 KB · Views: 12

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Updated up to highest current samp version.
Working on all samp versions.
Working while gta sa window is paused / minimized.
Activation working with command:
/asc

PHP:
{$CLEO .cs}

0000: "Parazitas"

REPEAT
IF 8256:   player $PLAYER_CHAR defined
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0256:   player $PLAYER_CHAR defined 

0AC8: 31@ = allocate_memory_size 1024 // allocate memory to format command
0AD3: 31@ = string_format "asc" // format command name
0AC7: 30@ = var 30@ pointer
0AC7: 29@ = var 29@ pointer
0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
30@ = 0 // default disabled
29@ = 0 // null ptr
0A8C: write_memory 0x74542B size 8 value 0x9090909090909090 virtual_protect 1 // set to disable mouse focus and centering when gta window not focused

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined 
THEN
    ////////////////////////////////////////////////////////// Command Check.. 
    IF 30@ <> 0
    THEN
        30@ = 0 // disable indication of the cmd
        IF 28@ == FALSE
        THEN
            28@ = TRUE
            0A8C: write_memory 0x747FB6 size 1 value 1 virtual_protect 1 // set gta window do not freeze when not focused
            0A8C: write_memory 0x74805A size 1 value 1 virtual_protect 1 // set gta window do not freeze when not focused
            0A8C: write_memory 0x53EA88 size 6 value 0x909090909090 virtual_protect 1 // set gta window do not freeze when is minimized and not focused
            0AD1: "~Y~Auto SignCheck: ~G~ON" 1337
        ELSE
            28@ = FALSE
            0A8C: write_memory 0x747FB6 size 1 value 0 virtual_protect 1 // reset to original value in order to disable
            0A8C: write_memory 0x74805A size 1 value 0 virtual_protect 1 // reset to original value in order to disable
            0AD1: "~Y~Auto SignCheck: ~R~OFF" 1337
        END     
    END
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    IF 28@ == TRUE
    THEN
        FOR 27@ = 95 TO 99
            0AC8: 26@ = allocate_memory_size 1024 // allocate memory to obtain returned text
            0AC8: 25@ = allocate_memory_size 1024 // allocate memory to obtain returned text
            0AB1: @getChatString 1 ChatID 27@ _Returned: Text 26@ PrefixText 25@ Color 24@ PrefixColor 23@
            0AC8: 22@ = allocate_memory_size 1024 // allocate memory to obtain returned text
            0AB1: @delete_color_codes_from_text 2 text 26@ memory_to_store_characters_as_text 22@
            0AC8: 21@ = allocate_memory_size 1024 // allocate memory to format text
            0AD3: 21@ = format "Type /signcheck" // format chat text to find and compare
            IF 0AB1: @if_text_contains 2 String1 22@ String2 21@ _Returned: text 20@
            THEN
                0209: 19@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
                wait 19@ // normal people can't answer instantly , so that why we need add timer
                0AC8: 18@ = allocate_memory_size 1024 // allocate memory to format text
                0AD3: 18@ = format "/signcheck" // format text
                0AB1: @process_chat_input 1 InputText 18@
                wait 1000 // wait to prevent spam
            END
        END
    
        IF 0AB1: @is_dialog_active 1 CheckingState TRUE // State: TRUE = active ; FALSE = closed
        THEN
            IF 0AB1: @get_dialog_caption 0 _Returned: Caption 27@
            THEN                                      
                0AC8: 26@ = allocate_memory_size 1024 // allocate memory to obtain returned text
                0AB1: @delete_color_codes_from_text 2 text 27@ memory_to_store_characters_as_text 26@
                0AC8: 25@ = allocate_memory_size 1024 // allocate memory to format text
                0AD3: 25@ = format "Sign check" // format text to find and compare
                IF 0AB1: @if_text_contains 2 String1 26@ String2 25@ _Returned: text 24@
                THEN
                    IF 0AB1: @get_dialog_text 0 _Returned: Text 23@
                    THEN
                        0AC8: 22@ = allocate_memory_size 1024 // allocate memory to obtain returned text
                        0AB1: @delete_color_codes_from_text 2 text 23@ memory_to_store_characters_as_text 22@
                        0AC8: 21@ = allocate_memory_size 1024 // allocate memory to obtain returned text
                        0AB1: @get_digits_to_print param_count 2 text 22@ memory_to_store_digits_as_text 21@
                        0AC8: 20@ = allocate_memory_size 1024 // allocate memory to format text
                        0AD3: 20@ = format "%s" 21@ // format text
                        0209: 19@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
                        wait 19@ // normal people can't answer instantly , so that why we need add timer
                        0AB1: @process_dialog_input 2 InputText 20@ Button 1 // 1 = Left , 0 = Right  
                        wait 1000 // wait to prevent spam      
                    END
                END
            END
        END
    END
END

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: ID 0@  
30@ = 0
IF 0AA2: 31@ = "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
    IF 29@ == 0x6094ACAB
    THEN // 0.3.7 R4 - v2
        30@ = 6
    END 
    IF 29@ == 0x6372C39E
    THEN // 0.3.7 R5
        30@ = 7
    END 
END
0AB2: ret 1 30@

:registerClientCommand
{
    Credits:
        Parazitas - UGBASE
        kawa_operand - BlastHack
        ajom - UGBASE
    
    Usage:
    0AC8: 31@ = allocate_memory_size 1024
    0AD3: 31@ = string_format "vr"
    0AC7: 30@ = var 30@ pointer
    0AC7: 29@ = var 29@ pointer
    0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
    30@ = 0 // default disabled
    29@ = 0 // null ptr
 
    Note:
        The Reference Pointers passed at _TogglingVar and _ParamPtrToVar are required to be treated as ReadOnly. Which means that the value of those two Reference Pointers should not be manually overwritten/changed.

    I am having a problem with opcode 0AB1, it permanently writes on the main thread's local variables. Maybe its because I directly writes on the passed variable's memory pointer. An example case:
        Passing _ParamPtrToVar = 31@ , _TogglingVar = 30@
            Opcode 0AB1 31@ == Main Thread's 31@
            Opcode 0AB1 30@ == Main Thread's 30@

    Thats why I decided to use global variables since they aren't that exposed on scripts.
}
CONST
    //    WARNING:
    //        Do not use Local Variables
    //        Do not recycle/use the three variables on any operation inside the script because these variables will always be used by this function and doesn't override outside the function. I promise you that even if you replace this with a local variable, It will cause overwriting mistakes that will mess the operation
    // You can Replace any of these variables into any UNIQUE GLOBAL VARIABLES
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    VAR5 = $2EBF
    VAR6 = $2FAA
END
IF 0AA2: VAR4 = "samp.dll"
THEN
        // ~~~~~~~~~~~~~ Create a New Callback Structure
        {
            51                      // push     ecx
            56                      // push     esi
            8B 74 24 0C             // mov     esi, [esp+0Ch]
            89 34 25 11 11 11 11    // mov     [11111111], esi // later: [11111111] becomes 1@
            83 35 11 11 11 11 01    // xor     [11111111], 01 // later: [11111111] becomes 2@
            5E                      // pop     esi
            59                      // pop     ecx
            C3 // retn
        }
            // Avoid using local variables by saving the values inside a global variables
    008A: VAR1 = 0@
    008A: VAR2 = 2@
    008A: VAR3 = 1@
            //
    0AC8: VAR5 = allocate_memory_size 23 // undeleteable memory region
    0084: VAR6 = VAR5
    0A8C: write_memory VAR6 size 4 value 0x748B5651 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0x34890C24 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 1 value 0x25 virtual_protect 1
    VAR6++
    // 0A8C: write_memory VAR2 size 4 value 0 virtual_protect 0 // null string // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR2 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 2 value 0x3583 virtual_protect 1
    VAR6 += 2
    // 0A8C: write_memory VAR3 size 4 value 0 virtual_protect 0 // Zeroing TogglingVar // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR3 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0xC3595E01 virtual_protect 1
        // ~~~~~~~~~~~~~ now callback struct VAR5 is ready
    0AB1: @get_samp_version_id 0 _returned: ID 17@ 
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN 
            0A8E: VAR6 = VAR4 + 0x21A0E8 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x65AD0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: VAR6 = VAR4 + 0x21A0F0 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x65BA0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: VAR6 = VAR4 + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x691B0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: VAR6 = VAR4 + 0x26E8CC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69000 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69730 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: VAR6 = VAR4 + 0x26EB84 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
    
        0AA6: call_method VAR4 struct VAR6 num_params 2 pop 0 VAR5 VAR1
    END
END
0AB2: ret 0

:getChatString
{
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@ 
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN 
            31@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        
        IF 17@ == 7 // 0.3.7 R5
        THEN
            31@ += 0x26EB80 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        0AA3: 31@
    END
END
0AB2: ret 4 30@ 29@ 27@ 24@

:process_chat_input
/*
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "text or /command"
    0AB1: @process_chat_input 1 InputText 1@
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN 
            0A8E: 30@ = 31@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x65D30 // PROCESS_INPUT
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0F0            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x65E00 // PROCESS_INPUT
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x69410 // PROCESS_INPUT
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E8CC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x69260 // PROCESS_INPUT
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x69990 // PROCESS_INPUT
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x699D0 // PROCESS_INPUT
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB84            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x699D0 // PROCESS_INPUT
        END
    
        0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
        0AA8: call_function_method 25@ struct 29@ num_params 0 pop 0 _retVal 7@
    END
END
0AB2: 0

:is_dialog_active
{
    Set TRUE if you wanna check when dialog is active
    Set FALSE if you wanna check when dialog is closed
    Usage:
    IF 0AB1: @is_dialog_active 1 CheckingState FALSE // State: TRUE = active ; FALSE = closed
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@ 
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN 
            0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 0@ == TRUE
        THEN
            IF 29@ == TRUE
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE
            IF 29@ == FALSE
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        END
    END
END
0AB2: ret 0

:get_dialog_caption
{
    0AB1: @get_dialog_caption 0 _Returned: Caption 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@ 
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN 
            0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 29@ == TRUE
        THEN
            0A8E: 28@ = 30@ + 0x40 // SAMP_DIALOG_CAPTION_OFFSET
            0485: dialog_open
            0AB2: ret 1 28@
        ELSE 059A:  dialog closed
        END
    END
END
0AB2: ret 0

:if_text_contains
{
    0AB1: @if_text_contains 2 String1 3@ String2 4@ _Returned: text 5@
}
0AB1: @strlen 1 string 0@ _Returned: length 31@
0AB1: @strlen 1 string 1@ _Returned: 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

:delete_color_codes_from_text
{
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @delete_color_codes_from_text 2 text 0@ memory_to_store_characters_as_text 1@
}
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 (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 28@ == 123
        THEN 5@ = TRUE // inbracket
        END
        
        IF 5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        END
        
        IF 28@ == 125
        THEN 5@ = FALSE // inbracket
        END
    END
0A8C: write_memory 1@ 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@ _length 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 0@ _Returned: length 31@
    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@

:get_dialog_text
{
    0AB1: @get_dialog_text 0 _Returned: Text 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _Returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN 
            0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 29@ == TRUE
        THEN
            0A8E: 28@ = 30@ + 0x34 // SAMP_DIALOG_TEXT_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
            28@ += 0x0
            0485: dialog_open
            0AB2: ret 1 28@
        ELSE 059A:  dialog closed
        END
    END
END
0AB2: ret 0

:process_dialog_input
/*
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "text"
    0AB1: @process_dialog_input 2 InputText 0@ Button 1 // 1 = Left , 0 = Right
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _Returned: ID 17@  
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN 
            0A8E: 30@ = 31@ + 0x21A0B8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6C040 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6C0F0 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x700D0 // SAMP_DIALOG_CLOSE_OFFSET
            
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6FF40 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70660 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70690 //SAMP_DIALOG_CLOSE
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70630 // SAMP_DIALOG_CLOSE_OFFSET
        END
    
        0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
        0AA8: call_function_method 25@ struct 29@ num_params 1 pop 0 Button 1@ _retVal 5@
    END
END
0AB2: 0

:Chatmsg
/*
     0AC8: 0@ = allocate_memory_size 1024
     0AD3: 0@ = format "{FFFFFF}Auto Accept: {00FF00}ON"
     0AB1: @Chatmsg 2 text 0@ color -1
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF NOT 0@ < 1
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E4            // SAMP_CHAT_INFO_OFFSET (R1)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x64010             // FUNC_ADDTOCHATWND (R1)
        END

        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0EC            // SAMP_CHAT_INFO_OFFSET (R2)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x640E0            // FUNC_ADDTOCHATWND (R2)
        END

        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA10            // SAMP_CHAT_INFO_OFFSET (DL)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67650             // FUNC_ADDTOCHATWND (DL)
        END

        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8C8            // SAMP_CHAT_INFO_OFFSET (R3)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67460             // FUNC_ADDTOCHATWND (R3)
        END

        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BA0             // FUNC_ADDTOCHATWND (R4) 699D0
        END
      
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
        
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB80            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
                
        IF OR
        1@ == -1
        1@ <= 0
        THEN 1@ = 0xFFFFFFFF
        END
        0AA6: call 29@ struct 30@ num_params 5 pop 0 params 0 1@ 0 0@ 8
    END
END
0AB2: 0

:isWindowMinimized
{
    0AB1: @isWindowMinimized 0
}
0A8D: 31@ = read_memory 0xC97C1C size 4 virtual_protect 0 // window handle pointer
0A8D: 30@ = read_memory 0x85825C size 4 virtual_protect 0 // IsIconic call function pointer
0AA7: call_function 30@ num_params 1 pop 0 WindowHandle 31@ _Returned: State 29@
IF 29@ > 0
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AB2: 0
 

Vilhelm

Member
Joined
Apr 15, 2023
Messages
12
Reaction score
0
Updated up to highest current samp version.
Working on all samp versions.
Working while gta sa window is paused / minimized.
Activation working with command:
/asc

PHP:
{$CLEO .cs}

0000: "Parazitas"

REPEAT
IF 8256:   player $PLAYER_CHAR defined
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0256:   player $PLAYER_CHAR defined

0AC8: 31@ = allocate_memory_size 1024 // allocate memory to format command
0AD3: 31@ = string_format "asc" // format command name
0AC7: 30@ = var 30@ pointer
0AC7: 29@ = var 29@ pointer
0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
30@ = 0 // default disabled
29@ = 0 // null ptr
0A8C: write_memory 0x74542B size 8 value 0x9090909090909090 virtual_protect 1 // set to disable mouse focus and centering when gta window not focused

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    ////////////////////////////////////////////////////////// Command Check..
    IF 30@ <> 0
    THEN
        30@ = 0 // disable indication of the cmd
        IF 28@ == FALSE
        THEN
            28@ = TRUE
            0A8C: write_memory 0x747FB6 size 1 value 1 virtual_protect 1 // set gta window do not freeze when not focused
            0A8C: write_memory 0x74805A size 1 value 1 virtual_protect 1 // set gta window do not freeze when not focused
            0A8C: write_memory 0x53EA88 size 6 value 0x909090909090 virtual_protect 1 // set gta window do not freeze when is minimized and not focused
            0AD1: "~Y~Auto SignCheck: ~G~ON" 1337
        ELSE
            28@ = FALSE
            0A8C: write_memory 0x747FB6 size 1 value 0 virtual_protect 1 // reset to original value in order to disable
            0A8C: write_memory 0x74805A size 1 value 0 virtual_protect 1 // reset to original value in order to disable
            0AD1: "~Y~Auto SignCheck: ~R~OFF" 1337
        END  
    END
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    IF 28@ == TRUE
    THEN
        FOR 27@ = 95 TO 99
            0AC8: 26@ = allocate_memory_size 1024 // allocate memory to obtain returned text
            0AC8: 25@ = allocate_memory_size 1024 // allocate memory to obtain returned text
            0AB1: @getChatString 1 ChatID 27@ _Returned: Text 26@ PrefixText 25@ Color 24@ PrefixColor 23@
            0AC8: 22@ = allocate_memory_size 1024 // allocate memory to obtain returned text
            0AB1: @delete_color_codes_from_text 2 text 26@ memory_to_store_characters_as_text 22@
            0AC8: 21@ = allocate_memory_size 1024 // allocate memory to format text
            0AD3: 21@ = format "Type /signcheck" // format chat text to find and compare
            IF 0AB1: @if_text_contains 2 String1 22@ String2 21@ _Returned: text 20@
            THEN
                0209: 19@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
                wait 19@ // normal people can't answer instantly , so that why we need add timer
                0AC8: 18@ = allocate_memory_size 1024 // allocate memory to format text
                0AD3: 18@ = format "/signcheck" // format text
                0AB1: @process_chat_input 1 InputText 18@
                wait 1000 // wait to prevent spam
            END
        END
 
        IF 0AB1: @is_dialog_active 1 CheckingState TRUE // State: TRUE = active ; FALSE = closed
        THEN
            IF 0AB1: @get_dialog_caption 0 _Returned: Caption 27@
            THEN                                   
                0AC8: 26@ = allocate_memory_size 1024 // allocate memory to obtain returned text
                0AB1: @delete_color_codes_from_text 2 text 27@ memory_to_store_characters_as_text 26@
                0AC8: 25@ = allocate_memory_size 1024 // allocate memory to format text
                0AD3: 25@ = format "Sign check" // format text to find and compare
                IF 0AB1: @if_text_contains 2 String1 26@ String2 25@ _Returned: text 24@
                THEN
                    IF 0AB1: @get_dialog_text 0 _Returned: Text 23@
                    THEN
                        0AC8: 22@ = allocate_memory_size 1024 // allocate memory to obtain returned text
                        0AB1: @delete_color_codes_from_text 2 text 23@ memory_to_store_characters_as_text 22@
                        0AC8: 21@ = allocate_memory_size 1024 // allocate memory to obtain returned text
                        0AB1: @get_digits_to_print param_count 2 text 22@ memory_to_store_digits_as_text 21@
                        0AC8: 20@ = allocate_memory_size 1024 // allocate memory to format text
                        0AD3: 20@ = format "%s" 21@ // format text
                        0209: 19@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
                        wait 19@ // normal people can't answer instantly , so that why we need add timer
                        0AB1: @process_dialog_input 2 InputText 20@ Button 1 // 1 = Left , 0 = Right
                        wait 1000 // wait to prevent spam   
                    END
                END
            END
        END
    END
END

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: ID 0@
30@ = 0
IF 0AA2: 31@ = "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
    IF 29@ == 0x6094ACAB
    THEN // 0.3.7 R4 - v2
        30@ = 6
    END
    IF 29@ == 0x6372C39E
    THEN // 0.3.7 R5
        30@ = 7
    END
END
0AB2: ret 1 30@

:registerClientCommand
{
    Credits:
        Parazitas - UGBASE
        kawa_operand - BlastHack
        ajom - UGBASE
 
    Usage:
    0AC8: 31@ = allocate_memory_size 1024
    0AD3: 31@ = string_format "vr"
    0AC7: 30@ = var 30@ pointer
    0AC7: 29@ = var 29@ pointer
    0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
    30@ = 0 // default disabled
    29@ = 0 // null ptr
 
    Note:
        The Reference Pointers passed at _TogglingVar and _ParamPtrToVar are required to be treated as ReadOnly. Which means that the value of those two Reference Pointers should not be manually overwritten/changed.

    I am having a problem with opcode 0AB1, it permanently writes on the main thread's local variables. Maybe its because I directly writes on the passed variable's memory pointer. An example case:
        Passing _ParamPtrToVar = 31@ , _TogglingVar = 30@
            Opcode 0AB1 31@ == Main Thread's 31@
            Opcode 0AB1 30@ == Main Thread's 30@

    Thats why I decided to use global variables since they aren't that exposed on scripts.
}
CONST
    //    WARNING:
    //        Do not use Local Variables
    //        Do not recycle/use the three variables on any operation inside the script because these variables will always be used by this function and doesn't override outside the function. I promise you that even if you replace this with a local variable, It will cause overwriting mistakes that will mess the operation
    // You can Replace any of these variables into any UNIQUE GLOBAL VARIABLES
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    VAR5 = $2EBF
    VAR6 = $2FAA
END
IF 0AA2: VAR4 = "samp.dll"
THEN
        // ~~~~~~~~~~~~~ Create a New Callback Structure
        {
            51                      // push     ecx
            56                      // push     esi
            8B 74 24 0C             // mov     esi, [esp+0Ch]
            89 34 25 11 11 11 11    // mov     [11111111], esi // later: [11111111] becomes 1@
            83 35 11 11 11 11 01    // xor     [11111111], 01 // later: [11111111] becomes 2@
            5E                      // pop     esi
            59                      // pop     ecx
            C3 // retn
        }
            // Avoid using local variables by saving the values inside a global variables
    008A: VAR1 = 0@
    008A: VAR2 = 2@
    008A: VAR3 = 1@
            //
    0AC8: VAR5 = allocate_memory_size 23 // undeleteable memory region
    0084: VAR6 = VAR5
    0A8C: write_memory VAR6 size 4 value 0x748B5651 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0x34890C24 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 1 value 0x25 virtual_protect 1
    VAR6++
    // 0A8C: write_memory VAR2 size 4 value 0 virtual_protect 0 // null string // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR2 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 2 value 0x3583 virtual_protect 1
    VAR6 += 2
    // 0A8C: write_memory VAR3 size 4 value 0 virtual_protect 0 // Zeroing TogglingVar // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR3 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0xC3595E01 virtual_protect 1
        // ~~~~~~~~~~~~~ now callback struct VAR5 is ready
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: VAR6 = VAR4 + 0x21A0E8 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x65AD0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: VAR6 = VAR4 + 0x21A0F0 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x65BA0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: VAR6 = VAR4 + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x691B0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: VAR6 = VAR4 + 0x26E8CC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69000 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69730 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: VAR6 = VAR4 + 0x26EB84 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
 
        0AA6: call_method VAR4 struct VAR6 num_params 2 pop 0 VAR5 VAR1
    END
END
0AB2: ret 0

:getChatString
{
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            31@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 7 // 0.3.7 R5
        THEN
            31@ += 0x26EB80 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        0AA3: 31@
    END
END
0AB2: ret 4 30@ 29@ 27@ 24@

:process_chat_input
/*
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "text or /command"
    0AB1: @process_chat_input 1 InputText 1@
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
       
            0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x65D30 // PROCESS_INPUT
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0F0            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
       
            0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x65E00 // PROCESS_INPUT
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
       
            0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x69410 // PROCESS_INPUT
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8CC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
       
            0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x69260 // PROCESS_INPUT
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
       
            0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x69990 // PROCESS_INPUT
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
       
            0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x699D0 // PROCESS_INPUT
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB84            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
       
            0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x699D0 // PROCESS_INPUT
        END
 
        0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
        0AA8: call_function_method 25@ struct 29@ num_params 0 pop 0 _retVal 7@
    END
END
0AB2: 0

:is_dialog_active
{
    Set TRUE if you wanna check when dialog is active
    Set FALSE if you wanna check when dialog is closed
    Usage:
    IF 0AB1: @is_dialog_active 1 CheckingState FALSE // State: TRUE = active ; FALSE = closed
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 0@ == TRUE
        THEN
            IF 29@ == TRUE
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE
            IF 29@ == FALSE
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        END
    END
END
0AB2: ret 0

:get_dialog_caption
{
    0AB1: @get_dialog_caption 0 _Returned: Caption 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 29@ == TRUE
        THEN
            0A8E: 28@ = 30@ + 0x40 // SAMP_DIALOG_CAPTION_OFFSET
            0485: dialog_open
            0AB2: ret 1 28@
        ELSE 059A:  dialog closed
        END
    END
END
0AB2: ret 0

:if_text_contains
{
    0AB1: @if_text_contains 2 String1 3@ String2 4@ _Returned: text 5@
}
0AB1: @strlen 1 string 0@ _Returned: length 31@
0AB1: @strlen 1 string 1@ _Returned: 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

:delete_color_codes_from_text
{
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @delete_color_codes_from_text 2 text 0@ memory_to_store_characters_as_text 1@
}
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 (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 28@ == 123
        THEN 5@ = TRUE // inbracket
        END
     
        IF 5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        END
     
        IF 28@ == 125
        THEN 5@ = FALSE // inbracket
        END
    END
0A8C: write_memory 1@ 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@ _length 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 0@ _Returned: length 31@
    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@

:get_dialog_text
{
    0AB1: @get_dialog_text 0 _Returned: Text 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _Returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
            0A8D: 29@ = readMem 29@ sz 4 vp 0
        END
        IF 29@ == TRUE
        THEN
            0A8E: 28@ = 30@ + 0x34 // SAMP_DIALOG_TEXT_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
            28@ += 0x0
            0485: dialog_open
            0AB2: ret 1 28@
        ELSE 059A:  dialog closed
        END
    END
END
0AB2: ret 0

:process_dialog_input
/*
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "text"
    0AB1: @process_dialog_input 2 InputText 0@ Button 1 // 1 = Left , 0 = Right
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _Returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0B8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
       
            0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6C040 // SAMP_DIALOG_CLOSE_OFFSET
        END
     
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
       
            0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6C0F0 // SAMP_DIALOG_CLOSE_OFFSET
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
       
            0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x700D0 // SAMP_DIALOG_CLOSE_OFFSET
         
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E898          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
       
            0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6FF40 // SAMP_DIALOG_CLOSE_OFFSET
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
       
            0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70660 // SAMP_DIALOG_CLOSE_OFFSET
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
       
            0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70690 //SAMP_DIALOG_CLOSE
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
       
            0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70630 // SAMP_DIALOG_CLOSE_OFFSET
        END
 
        0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
        0AA8: call_function_method 25@ struct 29@ num_params 1 pop 0 Button 1@ _retVal 5@
    END
END
0AB2: 0

:Chatmsg
/*
     0AC8: 0@ = allocate_memory_size 1024
     0AD3: 0@ = format "{FFFFFF}Auto Accept: {00FF00}ON"
     0AB1: @Chatmsg 2 text 0@ color -1
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF NOT 0@ < 1
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E4            // SAMP_CHAT_INFO_OFFSET (R1)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x64010             // FUNC_ADDTOCHATWND (R1)
        END

        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0EC            // SAMP_CHAT_INFO_OFFSET (R2)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x640E0            // FUNC_ADDTOCHATWND (R2)
        END

        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA10            // SAMP_CHAT_INFO_OFFSET (DL)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67650             // FUNC_ADDTOCHATWND (DL)
        END

        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8C8            // SAMP_CHAT_INFO_OFFSET (R3)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67460             // FUNC_ADDTOCHATWND (R3)
        END

        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BA0             // FUNC_ADDTOCHATWND (R4) 699D0
        END
   
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
     
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB80            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
             
        IF OR
        1@ == -1
        1@ <= 0
        THEN 1@ = 0xFFFFFFFF
        END
        0AA6: call 29@ struct 30@ num_params 5 pop 0 params 0 1@ 0 0@ 8
    END
END
0AB2: 0

:isWindowMinimized
{
    0AB1: @isWindowMinimized 0
}
0A8D: 31@ = read_memory 0xC97C1C size 4 virtual_protect 0 // window handle pointer
0A8D: 30@ = read_memory 0x85825C size 4 virtual_protect 0 // IsIconic call function pointer
0AA7: call_function 30@ num_params 1 pop 0 WindowHandle 31@ _Returned: State 29@
IF 29@ > 0
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AB2: 0
when i /asc it works i see the popup message but mouse doesn't work when alt tab out then in game and i waited for the signcheck and nothing happened and i tried in all samp versions
 
Top