CLEO Help getChatEntryText in sampfunc or for 0.3.7

CLEO related
Status
Not open for further replies.

Edd004

Active member
Joined
Mar 10, 2013
Messages
155
Reaction score
0
i used getChatEntryText snippet but its for 0.3z  :bawww:

snippet
:getChatEntryText
0AB1: call @GetSampBase 0 1@
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: ret 1 1@

:GetSampBase
0AA2: 31@ = load_library "kernel32.dll" // IF and SET
0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ // IF and SET
0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
0ab2: ret 1 0@
so then i need to know what kind of opcode use in sampfunc to get the chat text  :forever_hurra:
i used 0B75: samp get_chat_string 10@ text_to 1@ prefix_to 3@ color_to 4@ prefix_color_to 5@

but it seems not working  :eek:hgodwhy:

plz someone update the snippet or gimme the opcode in sampfunc  :yesyes:
 

Edd004

Active member
Joined
Mar 10, 2013
Messages
155
Reaction score
0
0B36 link said:
replace 0x212A6C with 0x21A0E4 for 0.3.7
no more crash  :not_bad:
but my script seems not working  :lol:

part of the script
:LABEL
wait 0
if
SAMP.Available()
jf [member=23507]Label[/member]
0AC8: 1@ = allocate_memory_size 260
0AB1: call @getChatEntryText 1 id 0@ to 1@
0AC8: 2@ = allocate_memory_size 260
if
0AD4: $NOT_USED = 1@ format "its something %s xD" 2@
then
//no need to know the rest :v

Coriolanus link said:
Ohh man are you updateing 4find ? YESSSSSS  :forever_hurra:
already update it  :forever_hurra:
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Code:
:getChatEntryText
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0E4
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@ 
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@
 

Edd004

Active member
Joined
Mar 10, 2013
Messages
155
Reaction score
0
springfield link said:
What didn't work? The getChatLine function?
changed the size to 100 and use your updated script  :me_gusta:
well nothing work for me  :eek:key:

example script
{$CLEO}
0000: NOP

:LABEL
wait 0
if
SAMP.Available()
jf [member=23507]Label[/member]
0AC8: 1@ = allocate_memory_size 100
0AB1: call @getChatEntryText 1 id 0@ to 1@
0AC8: 2@ = allocate_memory_size 100
if
0AD4: $NOT_USED = 1@ format "horry shet %s" 2@
then
wait 2500
0AF9: samp say_msg "/fap %s" 2@
wait 7000
end
jump [member=23507]Label[/member]

:getChatEntryText
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0E4
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Edd004 link said:
changed the size to 100 and use your updated script  :me_gusta:
well nothing work for me  :eek:key:

There are 100 chat lines, for each line there's a stChatEntry with size 252, the max text size is 144.
So allocating 145 bytes is enough(0AC8: 1@ = allocate_mem 145), allocating less will not get the entire chat line.

There are many things wrong with your script, 0@ is not defined so it's 0, that means the first line in chat.
Opcode 0AD4 can't store strings to normal vars, only @v.

Code:
:LABEL
wait 0
if
SAMP.Available()
jf @Label

while true
wait 0
0AC8: 1@ = allocate_memory_size 145
0ac8: 2@ = 100
0AB1: call @getChatEntryText 1 id 99 to 1@
    if 0AD4: $NOT_USED = 1@ format "horry shet %s" 2@v
    then
        wait 2500
        0AF9: samp say_msg "fap %s" 2@v
        wait 7000
    end
end
 

Edd004

Active member
Joined
Mar 10, 2013
Messages
155
Reaction score
0
springfield link said:
There are 100 chat lines, for each line there's a stChatEntry with size 252, the max text size is 144.
So allocating 145 bytes is enough(0AC8: 1@ = allocate_mem 145), allocating less will not get the entire chat line.

There are many things wrong with your script, 0@ is not defined so it's 0, that means the first line in chat.
Opcode 0AD4 can't store strings to normal vars, only @v.

Code:
:LABEL
wait 0
if
SAMP.Available()
jf [member=23507]Label[/member]

while true
wait 0
0AC8: 1@ = allocate_memory_size 145
0ac8: 2@ = 100
0AB1: call @getChatEntryText 1 id 99 to 1@
    if 0AD4: $NOT_USED = 1@ format "horry shet %s" 2@v
    then
        wait 2500
        0AF9: samp say_msg "fap %s" 2@v
        wait 7000
    end
end

thx man  :yesyes:
you're my savior  :forever_hurra:
 
Status
Not open for further replies.
Top