CLEO Help Chat reply

CLEO related
Status
Not open for further replies.

Renglee

Member
Joined
Apr 3, 2020
Messages
14
Reaction score
2
Location
Romania
Hello, i have a problem with this.This cleo when see on the chat a msg like this https://ibb.co/16dCTvd, he need to do automatic "/accept licence %s" but don t work
Code:
{$CLEO .cs}
0000: NOP

REPEAT
WAIT 0
UNTIL 0AFA:
30@ == true

WHILE TRUE
WAIT 0

if
0B61:  samp is_local_player_spawned
then
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@   
    if
    0C29: $NOT_USED = stristr string1 0@ string2 "%s request flying licence."
    then
        0af9: "/accept licence %s"     
        wait  1500
        30@ == false
      
      
    end
 
  end
  end
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
PHP:
{$CLEO}

0000:

wait 8500

while true
wait 0

if
0B61:  samp is_local_player_spawned
then
    for 0@ = 98 to 99 // last two lines
        0AC8: 1@ = allocate_memory_size 260 // allocate to get text
        0AC8: 2@ = allocate_memory_size 260 // allocate prext , not used , but is important to allocate
        0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
        if 
        0C29: $NOT_USED = stristr string1 1@ string2 "request flying licence"
        then
            if
            0C29: $NOT_USED = stristr string1 1@ string2 "/accept licence"
            then
                0AC8: 1@ = allocate_memory_size 260 // allocate to get returned characters
                0AB1: @changeString param_count 4 text 1@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 5@ // Remove color codes
                0AC8: 6@ = allocate_memory_size 260 // allocate to get returned digits
                0AB1: @get_digits_to_print param_count 2 text 5@ memory_to_store_digits_as_text 6@
                0AF9: "/accept licence %s" 6@
                wait 1500 // anti spam 
            end  
        end  
    end
end 

end

:changeString
{
    0AB1: call_scm_func @changeString param_count 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
0C17: 31@ = strlen 0@
    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
}
0C17: 31@ = strlen 0@
    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
 

Renglee

Member
Joined
Apr 3, 2020
Messages
14
Reaction score
2
Location
Romania
PHP:
{$CLEO}

0000:

wait 8500

while true
wait 0

if
0B61:  samp is_local_player_spawned
then
    for 0@ = 98 to 99 // last two lines
        0AC8: 1@ = allocate_memory_size 260 // allocate to get text
        0AC8: 2@ = allocate_memory_size 260 // allocate prext , not used , but is important to allocate
        0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
        if
        0C29: $NOT_USED = stristr string1 1@ string2 "request flying licence"
        then
            if
            0C29: $NOT_USED = stristr string1 1@ string2 "/accept licence"
            then
                0AC8: 1@ = allocate_memory_size 260 // allocate to get returned characters
                0AB1: @changeString param_count 4 text 1@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 5@ // Remove color codes
                0AC8: 6@ = allocate_memory_size 260 // allocate to get returned digits
                0AB1: @get_digits_to_print param_count 2 text 5@ memory_to_store_digits_as_text 6@
                0AF9: "/accept licence %s" 6@
                wait 1500 // anti spam
            end 
        end 
    end
end

end

:changeString
{
    0AB1: call_scm_func @changeString param_count 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
0C17: 31@ = strlen 0@
    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
}
0C17: 31@ = strlen 0@
    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
Dont work
 

Attachments

  • image0-1.jpg
    image0-1.jpg
    6.5 MB · Views: 35
Status
Not open for further replies.
Top