CLEO Help Help - Read chat and replay

CLEO related

Angel9

Active member
Joined
May 6, 2021
Messages
65
Reaction score
2
Location
Belgrade, Serbia
Problem to read line - log = [07:42:23] {FF0000}SmS | Nick: Mau[ID: 3] || new message | use /msglist.

Code:
{$CLEO .cs}

0000: NOP
// f3
repeat
wait 0
until 0afa:

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
    0AD4: $NOT_USED = scan_string 0@ format "{FF0000}SmS | Nick: %s[ID: %i] || new message | use /msglist." 5@v 6@ //  .                  
     then
        wait 1000 // 1 sec
        0AF9: samp say_msg "/msglist %i" 6@ // command
    end
end
  END
 

Angel9

Active member
Joined
May 6, 2021
Messages
65
Reaction score
2
Location
Belgrade, Serbia
Code:
0B75: samp get_chat_string 99 text_to 0@ prefix_to $NOT_USED color_to $NOT_USED prefix_color_to $NOT_USED

Also, is it possible for the choice to be three texts, and to choose one of the 3 texts that is in the back line of the chat.

Example:
0AD4: $NOT_USED = scan_string 0@ format "{FF0000}SmS | Nick: %s[ID: %i] || new message | use /msglist." 5@v 6@ //

0AD4: $NOT_USED = scan_string 0@ format "{FF0000}Call | Nick: %s[ID: %i] || new call | use /calllist." 7@v 8@ //

0AD4: $NOT_USED = scan_string 0@ format "{FF0000}Ads | Nick: %s[ID: %i] || new Ad | use /adlist." 9@v 10@ //



How to:
2. Compare text
3. Get digits from text
 
Last edited:

Angel9

Active member
Joined
May 6, 2021
Messages
65
Reaction score
2
Location
Belgrade, Serbia
Not work, not detect text in chat line...
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@ = 98 TO 99 // GET TWO LAST LINES
        0AC8: 1@ = allocate_memory_size 260 // ALLOC TO GET TEXT
        0AC8: 2@ = allocate_memory_size 260 // ALLOC TO GET PREFIX - NOT USING , BUT IS IMPORTANT TO ALLOCATE
        0B75: samp get_chat_string 0@ text_to 1@ prefix_to $NOT_USED color_to $NOT_USED prefix_color_to $NOT_USED // READ CHAT TEXT , ETC..
        IF
        0C29: 5@ = stristr string1 1@ string2 "SmS | Nick: %x[ID: %i] || new message | use /msglist." $NOT_USED 6@ // READ 1@ AND FIND PEACE OF TEXT, 5@ = RETURN ALL TEXT FROM THAT PEACE OF TEXT TILL END
        THEN
        wait 1000 // 1 sekunda
        0AF9: samp say_msg "/recon %i" 6@ // command
        wait 2000 // 5 sekundi
        0AB1: @SEND_FAKE_KEYPRESS 2 KeyOffSet 0x72 state 1
        wait 30000 // 30sec
        0AF9: samp say_msg "/uncon" // command
        wait 5000 // 5 sekunda
        0AB1: @STOP_SEND_FAKE_KEYPRESS 2 KeyOffSet 0x72 state 1
            END // END - 0C29: 7@ = stristr string1 5@ string2 "to redeem"
        END // END - 0C29: 5@ = stristr string1 1@ string2 "/redeemcreds"
    END // END - FOR 0@ = 98 TO 99 // GET TWO LAST LINES
END // END - CHECK 0B61:  samp is_local_player_spawned

:SEND_FAKE_KEYPRESS
if 0AA2: 2@ = load_library "User32.dll"
then
   if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
   then
       0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
       wait 1@
       0AA5: call 2@ num_params 4 pop 0 0 0x72 0 0@
   end
end
0AB2: ret 0
:STOP_SEND_FAKE_KEYPRESS
if 0AA2: 2@ = load_library "User32.dll"
then
   if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
   then
       0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
       wait 1@
       0AA5: call 2@ num_params 4 pop 0 0 0x72 0 0@
   end
end
0AB2: ret 0
 
Top