CLEO Help running the script multiple times

CLEO related

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
Code:
if 9@ == true
    then
                                for 1@ = 0 to 2304
                                if 0C5D: samp textdraw 1@ is_exists
                                then
                                    alloc 2@ = 1024
                                    0C5A: samp textdraw 1@ get_string_to 2@
                                    if 0C21: stricmp string1 2@ string2 "FISHA"       
                                    then
                                        0BCA: samp send_click_textdraw 1@
                                        free 2@
                            /////////////////////////////////////////////////////////////
                                        
                                        9@ = false
                                        wait 100
                                    end
                                    free 2@
                                end
                                end
                            end
how can i make for example this script to be repeatead 20 times? i want to have a command like /autoplay 50 and to repeat this 50 times or what number i want
can somebody help please?
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
165
Location
Poland
/test 128
PHP:
{$CLEO .cs}
{$USE bitwise}
0000:

0B34: samp register_client_command "test" to_label @cmd_test

WHILE TRUE
WAIT 0

IF 0ADC:   test_cheat "OP"
THEN
    0B12: 9@ = 9@ XOR 1        
    IF 0039:   9@ == 1
    THEN 0AD1: show_formatted_text_highpriority "~g~On" time 1337
    ELSE 0AD1: show_formatted_text_highpriority "~r~Off" time 137   
    END
END

IF 9@ == 1
THEN
    IF 0256:   player $PLAYER_CHAR defined
    THEN
        FOR 1@ = 0 TO 2304
            IF 0C5D: samp textdraw 1@ is_exists
            THEN
                0AC8: 2@ = allocate_memory_size 1024
                0C5A: samp textdraw 1@ get_string_to 2@
                IF 0C21: stricmp string1 2@ string2 "FISHA"       
                THEN
                    FOR 3@ = 0 TO 4@
                        0BCA: samp send_click_textdraw 1@                                                         
                        WAIT 100
                    END
                    9@ = 0
                END
                0AC9: free_allocated_memory 2@
            END
        END    
    END
END

END
0A93: terminate_this_custom_script

:cmd_test
0B35: samp 0@ = get_last_command_params
0C1A: 4@ = atoi 0@
0B43: samp cmd_ret
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
Thank you!
Code:
:cmd_test
0B35: samp 0@ = get_last_command_params
0C1A: 4@ = atoi 0@
0B43: samp cmd_ret

0C1A: 4@ = atoi 0@

0@ is the whole command like /test 128 and this opcode is extracting just the number and put in 4@ ?
 
Top