CLEO Help Auto replay

CLEO related
Status
Not open for further replies.

RazooorS

Active member
Joined
Feb 16, 2019
Messages
60
Reaction score
0
Can someone make script to auto replay like that:
When in chat show Kuca you type command /buyhouse and this is it
Like this but this dont work for me
Code:
{$CLEO .cs}

0000:

REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
   WAIT 0


IF
0B61:  samp is_local_player_spawned
THEN
    FOR 0@ = 99 TO 99 // Can be changed to 98 to 99, 97 to 99 - it reads the last amount of lines from the log. In this case, it reads just the last one.
        0AC8: 1@ = allocate_memory_size 260
        0AC8: 2@ = allocate_memory_size 260
        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 "text" // Text to look for in the chat to start the sequence. It will catch anything that has "text" anywhere in the chat.
        THEN
                0AF9: samp say_msg "reply" // What you want to say when someone says "text" in the chat.
                wait 50
                0AF8: samp add_message_to_chat "Success." color 0x000000 // Avoid endless looping by adding a debug message to the chat.
                wait 50
        END
    END
END

END
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
{$CLEO .cs}

0000:

REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
   WAIT 0


IF 0B61:  samp is_local_player_spawned
THEN
    FOR 0@ = 99 TO 99 
        0AC8: 1@ = allocate_memory_size 260
        0AC8: 2@ = allocate_memory_size 260
        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 "type command /buyhouse"
        THEN
            0AF9: samp say_msg "/buyhouse"
            0AF8: "" color 0xFF00FF00 
        END
    END
END

END
 

RazooorS

Active member
Joined
Feb 16, 2019
Messages
60
Reaction score
0
PHP:
{$CLEO .cs}

0000:

REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
   WAIT 0


IF 0B61:  samp is_local_player_spawned
THEN
    FOR 0@ = 99 TO 99
        0AC8: 1@ = allocate_memory_size 260
        0AC8: 2@ = allocate_memory_size 260
        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 "type command /buyhouse"
        THEN
            0AF9: samp say_msg "/buyhouse"
            0AF8: "" color 0xFF00FF00
        END
    END
END

END
I have error with this cleo see
 

RazooorS

Active member
Joined
Feb 16, 2019
Messages
60
Reaction score
0
PHP:
{$CLEO .cs}

0000:

REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
   WAIT 0


IF 0B61:  samp is_local_player_spawned
THEN
    FOR 0@ = 99 TO 99
        0AC8: 1@ = allocate_memory_size 260
        0AC8: 2@ = allocate_memory_size 260
        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 "type command /buyhouse"
        THEN
            0AF9: samp say_msg "/buyhouse"
            0AF8: "" color 0xFF00FF00
        END
    END
END

END
I fix and compile this and my gta got crashed do you have fix ?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
R4
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = "type command /buyhouse" // Check / find text

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ "/buyhouse" // CMD

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 1@
    if   
    0AB1: @IfTextContains 2 String1 1@ String2 2@ _returned: text 3@
    then
        0AB1: @SEND_CMD 1 Command 4@
        wait 10000 // anti spam
    end
end

end

:getChatEntryText
{
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@ 
    0.3.7 - R4
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26E9F8
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@ 
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

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

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

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

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

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

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text

}
5@ = FALSE // inbracket
0AB1: @strlen 1 string 0@ _return: 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end

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

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

: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 1 Command 3@
    0.3.7 - R4
}
IF 0AA2: 2@ = "samp.dll"
THEN      
    0A8E: 3@ = 2@ + 0x698C0
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0
 

RazooorS

Active member
Joined
Feb 16, 2019
Messages
60
Reaction score
0
R4
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = "type command /buyhouse" // Check / find text

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ "/buyhouse" // CMD

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 1@
    if 
    0AB1: @IfTextContains 2 String1 1@ String2 2@ _returned: text 3@
    then
        0AB1: @SEND_CMD 1 Command 4@
        wait 10000 // anti spam
    end
end

end

:getChatEntryText
{
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@
    0.3.7 - R4
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26E9F8
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

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

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

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

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

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

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text

}
5@ = FALSE // inbracket
0AB1: @strlen 1 string 0@ _return: 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end

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

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

: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 1 Command 3@
    0.3.7 - R4
}
IF 0AA2: 2@ = "samp.dll"
THEN    
    0A8E: 3@ = 2@ + 0x698C0
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0
Thanks
 
Last edited:

RazooorS

Active member
Joined
Feb 16, 2019
Messages
60
Reaction score
0
R4
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = "type command /buyhouse" // Check / find text

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ "/buyhouse" // CMD

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 1@
    if 
    0AB1: @IfTextContains 2 String1 1@ String2 2@ _returned: text 3@
    then
        0AB1: @SEND_CMD 1 Command 4@
        wait 10000 // anti spam
    end
end

end

:getChatEntryText
{
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@
    0.3.7 - R4
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26E9F8
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

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

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

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

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

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

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text

}
5@ = FALSE // inbracket
0AB1: @strlen 1 string 0@ _return: 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end

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

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

: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 1 Command 3@
    0.3.7 - R4
}
IF 0AA2: 2@ = "samp.dll"
THEN    
    0A8E: 3@ = 2@ + 0x698C0
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0
I try this script but when this word show in chat dont say command only got crash...
 

RazooorS

Active member
Joined
Feb 16, 2019
Messages
60
Reaction score
0
R4
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = "type command /buyhouse" // Check / find text

0AC8: 4@ = allocate_memory_size 260
0AD3: 4@ "/buyhouse" // CMD

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 1@
    if  
    0AB1: @IfTextContains 2 String1 1@ String2 2@ _returned: text 3@
    then
        0AB1: @SEND_CMD 1 Command 4@
        wait 10000 // anti spam
    end
end

end

:getChatEntryText
{
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@
    0.3.7 - R4
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26E9F8
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

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

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

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

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

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

059A:  return_false
0AB2: ret 1 0

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text

}
5@ = FALSE // inbracket
0AB1: @strlen 1 string 0@ _return: 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end

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

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

: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 1 Command 3@
    0.3.7 - R4
}
IF 0AA2: 2@ = "samp.dll"
THEN     
    0A8E: 3@ = 2@ + 0x698C0
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0
Can you help me?
 
Status
Not open for further replies.
Top