CLEO Help cleo cmd

CLEO related
Status
Not open for further replies.

Shlomou

Member
Joined
Apr 25, 2020
Messages
6
Reaction score
0
Location
Sfax
I would be very thankful if you guys help me out with this one.
Basically, every hour I receive a paycheck in the server along with a code that I need to insert for some IG credits and I want a cleo that automatically detects the code and insert it. I know this sounds lazy as fuck but the problem is with the code that the server sends, its MOSTLY! random characters for example (afFG0hIl) some-times it's kinda tricky with the (L/i/I/l).
I would really appreciate your help, I've tried to learn how to do such a thing but I couldn't :/
forgot to mention the basics, basically below is the text that appears in the chatbox for what i've stated about and THE_CODE_HERE is supposed to be the random characters i've told you about.

You have earned 10credits! do /redeemcreds THE_CODE_HERE to redeem these credits.

and the cmd supposd to be /redeemcreds THE_CODE_FROM_ABOVE
 
Last edited:

Shlomou

Member
Joined
Apr 25, 2020
Messages
6
Reaction score
0
Location
Sfax
Which samp your server use?
both 0.3.7 and 0.3DL, am probably using 0.3.7 which is compatible with sampfuncs. But as I said for some reasons I cannot compile ANY FILE by the way, i've tried editing some other cleo files and didn't manage to compile, but like 5days ago I had to edit GTA IV HUD's cleo to adjust it to my settings and it worked fine but for some unknown reasons, I cannot compile anyfile.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
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@ = 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 2@ color_to 3@ prefix_color_to 4@ // READ CHAT TEXT , ETC..
        IF
        0C29: 5@ = stristr string1 1@ string2 "/redeemcreds" // READ 1@ AND FIND PEACE OF TEXT, 5@ = RETURN ALL TEXT FROM THAT PEACE OF TEXT TILL END
        THEN
            0C17: 6@ = strlen 5@ // GET RETURNED TEXT SIZE
            IF
            0C29: 7@ = stristr string1 5@ string2 "to redeem" // READ 5@ RETURNED TEXT AND FIND PEACE OF TEXT, 7@ = RETURN ALL TEXT FROM THAT PEACE OF TEXT TILL END
            THEN
                0C17: 8@ = strlen 7@ // GET RETURNED TEXT SIZE
                0062: 6@ -= 8@ // DELETE FROM 6@ SIZE, 8@ - RETURNED TEXT SIZE , NOW YOU KNOW THE SIZE OF TEXT WHICH YOU NEED DELETE FROM 5@ RETURNED STRING
                0C24: strncpy destination 5@ source 5@ size 6@ // COPY STRING WITH NEW SIZE OF TEXT, NOW YOU HAVE ONLY - /redeemcreds S610ppYKB5
                5@ += 13 // /redeemcreds = 12 CHARACTERS + ONE CHARACTER FOR SPACE, WHICH MEANS WE SKIP 13 CHARACTERS AND FINALLY TEXT IS - S610ppYKB5
                CHATMSG "%s" -1 5@ // Debug / logger or whatever we calling it... xD
            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

END // END - WHILE TRUE

 
Last edited:

zaketej

Member
Joined
Jan 2, 2019
Messages
24
Reaction score
2
Location
@Parazitas is our God
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@ = 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 2@ color_to 3@ prefix_color_to 4@ // READ CHAT TEXT , ETC..
        IF
        0C29: 5@ = stristr string1 1@ string2 "/redeemcreds" // READ 1@ AND FIND PEACE OF TEXT, 5@ = RETURN ALL TEXT FROM THAT PEACE OF TEXT TILL END
        THEN
            0C17: 6@ = strlen 5@ // GET RETURNED TEXT SIZE
            IF
            0C29: 7@ = stristr string1 5@ string2 "to redeem" // READ 5@ RETURNED TEXT AND FIND PEACE OF TEXT, 7@ = RETURN ALL TEXT FROM THAT PEACE OF TEXT TILL END
            THEN
                0C17: 8@ = strlen 7@ // GET RETURNED TEXT SIZE
                0062: 6@ -= 8@ // DELETE FROM 6@ SIZE, 8@ - RETURNED TEXT SIZE , NOW YOU KNOW THE SIZE OF TEXT WHICH YOU NEED DELETE FROM 5@ RETURNED STRING
                0C24: strncpy destination 5@ source 5@ size 6@ // COPY STRING WITH NEW SIZE OF TEXT, NOW YOU HAVE ONLY - /redeemcreds S610ppYKB5
                5@ += 13 // /redeemcreds = 12 CHARACTERS + ONE CHARACTER FOR SPACE, WHICH MEANS WE SKIP 13 CHARACTERS AND FINALLY TEXT IS - S610ppYKB5
                CHATMSG "%s" -1 5@ // Debug / logger or whatever we calling it... xD
            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

END // END - WHILE TRUE

 
Status
Not open for further replies.
Top