Chat ID's

Status
Not open for further replies.
Joined
Nov 16, 2017
Messages
17
Likes
0
Points
1
#1
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

Well-Known Member
Joined
Jan 2, 2017
Messages
678
Likes
2
Points
18
Location
Lithuania
Website
ugbase.eu
#2
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: [email protected] = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
    0AB1: @GETCHATENTRYTEXT 1 id 99 to [email protected] // THIS IS A FUNCTION THAT STORES THE LAST CHAT STRING INTO [email protected] 
   
    IF
    0AD4: $NOT_USED = [email protected] format "%s (ID: %d) says: %s" $NOT_USED [email protected] $NOT_USED
    THEN
        say "Hello %d" [email protected]
        wait 1000
    END

    0AC9: free_allocated_memory [email protected] // FREE THE MEMORY
END
END

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