CLEO Help Getting Chat String

CLEO related

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
So I tried to make a script in which when the following is been said, it would say the next things in "" but it doesn't work... Can anyone help me please?
Code:
{$CLEO .cs}               
thread "Auto-Clicker"
0000:


repeat
wait 0
until SAMP.Available()

while true
wait 0
    SAMP.GetChatString(1@, 2@, 3@, 4@, 5@)
    alloc 2@ 260
    if or
    0C18: 10@ = strstr string1 2@ string2 "AFK LA PC"
    0C18: 10@ = strstr string1 2@ string2 "BAN PENTRU"
    0C18: 10@ = strstr string1 2@ string2 "AUTOCLICKER"
    0C18: 10@ = strstr string1 2@ string2 "AUTO-CLICKER"
    0C18: 10@ = strstr string1 2@ string2 "ESTI LA PC"
    then
        say "/stopanim"         
        wait 2000
        say "Da, sunt la PC :<."
        wait 1000
        say "/sleep"
    end
    free 2@
end
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Code:
{$CLEO .cs}               
thread "Auto-Clicker"
0000:


repeat
wait 0
until SAMP.Available()

while true
wait 0
END

:autoclicker
    alloc 2@ 260
    alloc 1@ 260
    
    SAMP.GetChatString(1@, 2@, 3@, 4@, 5@)
    if or
    0AD4: $NOT_USED = scan_string 2@ format "AFK LA PC"
    0AD4: $NOT_USED = scan_string 2@ format "BAN PENTRU"
    0AD4: $NOT_USED = scan_string 2@ format "AUTOCLICKER"
    0AD4: $NOT_USED = scan_string 2@ format "AUTO-CLICKER"
    0AD4: $NOT_USED = scan_string 2@ format "ESTI LA PC"
    then
        chatmsg "merge" -1
    else
        chatmsg "no merge" -1
    end
SAMP.CmdRet()
I tried it this way too, but it still won't work.. Even if the code is in the loop with free 2@ and free 1@
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,488
Reaction score
231
Location
( ͡° ͜ʖ ͡°)
Code:
{$CLEO .cs}               
thread "Auto-Clicker"
0000:


repeat
    wait 0
until SAMP.Available()

while true
wait 0
    alloc 2@ 260
    0B75: samp get_chat_string 99 text_to 2@ prefix_to 3@ color_to 4@ prefix_color_to 5@

    
    if or
    0C18: 10@ = strstr string1 2@ string2 "AFK LA PC"
    0C18: 10@ = strstr string1 2@ string2 "BAN PENTRU"
    0C18: 10@ = strstr string1 2@ string2 "AUTOCLICKER"
    0C18: 10@ = strstr string1 2@ string2 "AUTO-CLICKER"
    0C18: 10@ = strstr string1 2@ string2 "ESTI LA PC"
    then
        say "/stopanim"         
        wait 2000
        say "Da, sunt la PC :<."
        wait 1000
        say "/sleep"
    end
    free 2@
end
 
Top