CLEO Help read a line in chat

CLEO related
Status
Not open for further replies.

zaki19

Well-known member
Joined
Feb 27, 2013
Messages
393
Reaction score
0
hi guys i need a cleo that read a number in the last line of the chat and store it to 1@

the chat line is like that
*the phone number is "456123"
and i want it to store only numbers
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
0AC8: 0@ = allocate_memory_size 260

0AB1: call @getChatEntryText 1 id 99 to 0@
if
0AD4: 33@ = scan_string 0@v format "the phone number is "%d"" 5@ //IF and SET
then
    5@ - is now the phonee number
end
0AC9: free_allocated_memory 0@



:getChatEntryText
// 0AB1: call @getChatEntryText 1 id 0@ to 1@
{ In 0@ - number of chat line. 99 line is last.
Out 1@ - line text }
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@
 

zaki19

Well-known member
Joined
Feb 27, 2013
Messages
393
Reaction score
0
if
0AD4: 33@ = scan_string 0@v format "the phone number is "%d"" 5@ //IF and SET
then
    5@ - is now the phonee number
end

but i cant complier that in sanny builder i try to remove this nad make it look like that


0AC8: 0@ = allocate_memory_size 260

0AB1: call @getChatEntryText 1 id 99 to 0@
wait 1000
0AF9: samp say_msg "it is %s" 0@
wait 3000
0AD4: 33@ = scan_string 0@v format "the phone number is (%d)" 5@
wait 1000
0AF9: samp say_msg "number is %d" 5@
0AF9: samp say_msg "number is %s" 5@
0AC9: free_allocated_memory 0@



and it doesnt store the number the text is okay the number is alwase 0
 

zaki19

Well-known member
Joined
Feb 27, 2013
Messages
393
Reaction score
0
DOOOOOOOOOOOOOONE

SO THE PROBLEM WAS WHEN I TYPE
0AF9: samp say_msg "it is %s" 0@

SO IT USE THE 0@
AND IT GET NEW CHAT LINE AND IT NOT WORKS


THANKS OPCODE  :urtheman:  :urtheman:
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
%s = text
%d = numbers

Code:
while true
wait 0
0AC8: 0@ = allocate_memory_size 260
0AB1: call @getChatEntryText 1 id 99 to 0@
if 0AD4: 30@ = scan_string 0@ format "the phone number is %d" 5@ 
then
    0AF8: "%d" -1 5@
end
0AC9: free_allocated_memory 0@
end

:getChatEntryText
0AA2: 1@ = "samp.dll"
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 
005A: 1@ += 0@ /
1@ += 28
0AB2: ret 1 1@

You need to change to 0ad4 text with the one from your chat line(color included).
 
Status
Not open for further replies.
Top