CLEO Help Chat ID's

CLEO related
Status
Not open for further replies.

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
I've been looking at this by @monday
http://ugbase.eu/Thread-IfTextContains-function

I feel like this is sort of what I wanna do but the problem is it's never going to be the same string.

Here's what I'm trying to do:
I want to make the CLEO store the ID that it finds on a chat line, for example:
"John_Smith (ID: 43) says: Hello"
I want the CLEO to be able to get that ID.

Not sure if it's possible or if I can just edit the code in that thread above, I don't know.

Let me know.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,161
Solutions
5
Reaction score
894
Location
Lithuania
ItsRobinson said:
I've been looking at this by @monday
http://ugbase.eu/Thread-IfTextContains-function

I feel like this is sort of what I wanna do but the problem is it's never going to be the same string.

Here's what I'm trying to do:
I want to make the CLEO store the ID that it finds on a chat line, for example:
"John_Smith (ID: 43) says: Hello"
I want the CLEO to be able to get that ID.

Not sure if it's possible or if I can just edit the code in that thread above, I don't know.

Let me know.

Simple script...

PHP:
{$CLEO .cs}
0000:

REPEAT
    WAIT 0
UNTIL 0AFA:  is_samp_available
// MAKE THE CLEO ONLY WORK IF SAMPFUNCS IS LOADED


WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
    0AB1: @GETCHATENTRYTEXT 1 id 99 to 0@ // THIS IS A FUNCTION THAT STORES THE LAST CHAT STRING INTO 0@ 
   
    IF
    0AD4: $NOT_USED = 0@ format "%s (ID: %d) says: %s" $NOT_USED 2@ $NOT_USED
    THEN
        say "Hello %d" 2@
        wait 1000
    END

    0AC9: free_allocated_memory 0@ // FREE THE MEMORY
END
END

:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x21A0E4
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: 1 1@
 
Status
Not open for further replies.
Top