CLEO Help CLEO Wildcard with SAMPFUNCS? (*)

CLEO related
Status
Not open for further replies.

Wreko

Active member
Joined
Dec 13, 2014
Messages
40
Reaction score
0
Is there a way to use wildcards with strings/text in CLEO? There must be a way! Just not sure how...

For example:
Code:
0A92: create_custom_thread "*.cs"
Would load all files with extension .cs, as the wildcard replaces the rest of the text.


I think I saw it somewhere and I think I've tried something like this but I don't think what I tried worked...


thx
 

Wreko

Active member
Joined
Dec 13, 2014
Messages
40
Reaction score
0
in c++ that's something like this
http://stackoverflow.com/questions/8105809/how-to-use-wildcard-for-strings-matching-and-replacing
or
http://www.geeksforgeeks.org/wildcard-character-matching/
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,493
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
You do it by using other tricks..

This will load all .cs in folder CLEO\custom\ :

Code:
0AC8: 1@ = allocate_memory_size 260
IF
0AE6: 0@ = find_first_file "CLEO\custom\*.cs" get_filename_to 1@ // IF and SET
THEN
    REPEAT
        WAIT 0
        0A92: create_custom_thread 1@
    UNTIL 8AE7: not 1@ = find_next_file 0@ // IF and SET
END
0AC9: free_allocated_memory 1@
 

Wreko

Active member
Joined
Dec 13, 2014
Messages
40
Reaction score
0
Opcode.eXe link said:
You do it by using other tricks..

This will load all .cs in folder CLEO\custom\ :

Code:
0AC8: 1@ = allocate_memory_size 260
IF
0AE6: 0@ = find_first_file "CLEO\custom\*.cs" get_filename_to 1@ // IF and SET
THEN
    REPEAT
        WAIT 0
        0A92: create_custom_thread 1@
    UNTIL 8AE7: not 1@ = find_next_file 0@ // IF and SET
END
0AC9: free_allocated_memory 1@

Code:
0AE6: 0@ = find_first_file "CLEO\custom\*.cs" get_filename_to 1@ // IF and SET
So, the wildcard works?

Would it work with most of other opcodes that use strings?

Like:

Code:
0DC8: c_script 1@ load_from "*.c" is_file true
Code:
0777: delete_objects_in_object_group "BARRIERS*"
Code:
0A94: start_custom_mission "missions\*"
...


thanks :)
 
Status
Not open for further replies.
Top