CLEO Help Chat string

CLEO related
Status
Not open for further replies.

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
27
Hello, how to scan and get chat string from uppercase letter to uppercase letter and from uppercase letter to space?

Example: zzzzzzzzzAbcdefGhijklm zzzzzzzzz
I need to get: Abcdef and Ghijklm

@supahdupahnubah
@springfield
@monday
@Opcode.eXe
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
idk if theres a simpler was using some opcodes but what you could do is:
-loop for each letter in the string by using  0A8D: 0@ = read_memory 1@ size 1 virtual_protect 0   (1@ has to be increased for each letter, 0@ becomes the byte representing character)
-you will know that you reached the end of the string if the byte found is equal to 0
-use ascii table to know which characters are represented by what values (eg. space = 32, a = 97, z = 122, A = 65, Z = 90, "0" = 48,  "9" = 57)
-manage bunch of variables to monitor when characters had certain value, copy their pointers, keep track of the amount of sequences that you found (I guess that's the hardest part because with cleo it's easy to make some small mistake)

asciifull.gif


example of a condition to check whether it's capital or small case letter:
Code:
if and 
0029:   0@ >= 65
002B:   90 >= 0@
then
// 0@ represents capital letter
else 
    if and 
    0029:   0@ >= 97
    002B:   122 >= 0@
    then
    // 0@ represents lower case letter
    else 
        if and 
        0029:   0@ >= 48
        002B:   59 >= 0@
        then
        // 0@ represents digit
        else 
        end
    end
end
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
27
monday said:
idk if theres a simpler was using some opcodes but what you could do is:
-loop for each letter in the string by using  0A8D: 0@ = read_memory 1@ size 1 virtual_protect 0   (1@ has to be increased for each letter, 0@ becomes the byte representing character)
-you will know that you reached the end of the string if the byte found is equal to 0
-use ascii table to know which characters are represented by what values (eg. space = 32, a = 97, z = 122, A = 65, Z = 90, "0" = 48,  "9" = 57)
-manage bunch of variables to monitor when characters had certain value, copy their pointers, keep track of the amount of sequences that you found (I guess that's the hardest part because with cleo it's easy to make some small mistake)

asciifull.gif

What about that snippet? It copies the given chat string from one symbol to another
call @copy_string 4 text 0@ start 0 end 9 to_buffer 1@

Code:
:copy_string
var
    1@: int
    2@: int
    4@: int
    5@: int
end
if 1@ < 0
then
    059A: return_false
    ret 0 
end
0C17: 5@ = strlen 0@
if 2@ > 5@
then
    2@ = 5@
end
if 5@ <= 0
then
    059A: return_false
    ret 0
end
if 2@ < 1@
then
    059A: return_false
    ret 0
end
if 1@ >= 1
then
    for 4@ = 0 to 1@
    inc(0@)
    end
end
2@ -= 1@
inc(2@)
0C10: memcpy destination 3@ source 0@ size 2@
0485: return_true
ret 0
Is this possible to make same thing but from desired word to another word?
 
Status
Not open for further replies.
Top