CLEO Help Need some help

CLEO related
Status
Not open for further replies.

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
So, I see that many people are now including {$CLEO} instead of {$CLEO .cs} in their code. What does it change?

What's the difference between 0@ and 0@v?

Why isn't this working? It should send another sms to the same person but the nick is either (null) or I get exceptions when I send the sms.

Code:
{$CLEO .cs}
0000:

:1
wait 20000
jump @PEPE_39

:PEPE_39
wait 0  
0AC8: 0@ = allocate_memory_size 260
0AB1: call @getChatEntryText 1 id 98 to 0@ //98 IS NOT THE PROBLEM!
if 
0AD4: 30@ = scan_string 0@ format "SMS: [Vilius_Andreas >> %s ]:" 28@
else_jump @PEPE_39
jump @2

:2
wait 0
0AF9: "/sms %s Reply" 30@ 
0AC9: free_allocated_memory 0@     
jump @PEPE_39

:getChatEntryText
wait 500
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@
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
1) There's no difference, but it makes no sense to put ".cs" since it doesn't change anything.
2) 0@ is a simple variable, it has its memory and it's limited. But 0@v takes the next 4 variables (1@, 2@, 3@, 4@) and use their memory so you can store longer things in it. I recommend to alloc memory to 0@ for storing longer things (0AC8: 0@ = allocate_memory_size 260).
3)
Code:
{$CLEO}
0000: NOP

:SAMP
wait 0
if
SAMP.Available()
jf @SAMP

:MAIN
wait 0  
0AC8: 0@ = allocate_memory_size 260
0AB1: call @getChatEntryText 1 ID 98 to 0@ //98 IS NOT THE PROBLEM!
if 
0AD4: $NOTUSED = 0@ format "SMS: [%s >> %s ]:" 31@ $NOT_USED
jf @MAIN
0AF9: "/sms %s Reply" 31@      
goto @MAIN

: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@
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
TH3RM4L link said:
1) There's no difference, but it makes no sense to put ".cs" since it doesn't change anything.
2) 0@ is a simple variable, it has its memory and it's limited. But 0@v takes the next 4 variables (1@, 2@, 3@, 4@) and use their memory so you can store longer things in it. I recommend to alloc memory to 0@ for storing longer things (0AC8: 0@ = allocate_memory_size 260).
3)
Code:
{$CLEO}
0000: NOP

:SAMP
wait 0
if
SAMP.Available()
jf @SAMP

:MAIN
wait 0  
0AC8: 0@ = allocate_memory_size 260
0AB1: call @getChatEntryText 1 ID 98 to 0@ //98 IS NOT THE PROBLEM!
if 
0AD4: $NOTUSED = 0@ format "SMS: [%s >> %s ]:" 31@ $NOT_USED
jf @MAIN
0AF9: "/sms %s Reply" 31@      
goto @MAIN

: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@

Thanks a lot! I don't know why, but it doesn't work. Whenever I send a message to someone, my nick is Vilius_Andreas, as I understand it should send the message to me, but this happens:

Code:
[15:05:36] SMS: [Vilius_Andreas >> Ricaradas_Zuisliuis ]:

[15:05:36] test

[15:05:36] Warning(s007): Exception 0xC0000005 at 0x664B242C

[15:05:36] Warning(s007): Exception 0xC0000005 at 0x4641F6

[15:05:36] Warning(s007): Exception 0xC0000005 at 0x0

[15:05:36] Warning(s007): Exception 0xC0000005 at 0x0

[15:05:37] Warning(s007): Exception 0xC0000005 at 0x0

[15:05:37] Warning(s007): Exception 0xC0000005 at 0x0

[15:05:37] Warning(s007): Exception 0xC0000005 at 0x486DDF

[15:05:37] Warning(s007): Exception 0xC0000005 at 0x66566420

[15:05:37] Warning(s007): Exception 0xC0000005 at 0x0

[15:05:37] Warning(s007): Exception 0xC0000005 at 0x0

[15:05:37] Warning(s007): Exception 0xC0000005 at 0x0
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Code:
{$CLEO}
0000: NOP

:SAMP
wait 0
if
SAMP.Available()
jf @SAMP
0AC8: 1@ = allocate_memory_size 260
0AC8: 2@ = allocate_memory_size 260

:MAIN
wait 0  
0AB1: call @getChatEntryText 1 ID 98 to 1@
if 
0AD4: $NOT_USED = 1@ format "SMS: [%s >> %s ]:" $NOT_USED 2@
jf @MAIN
0AF9: "/SMS %s TEST" 2@      
goto @MAIN

:getChatEntryText
0AB1: call @GetSampBase 0 1@
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@

:GetSampBase
0AA2: 31@ = load_library "kernel32.dll" 
0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ 
0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
0ab2: ret 1 0@
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
You don't need to have kernel32.dll
It's weird 0AF9 is "/SMS %s TEST" but it displays "test" in your chat :surprised:
Press F10, go to Formats > Case coverting, check "As is", OK and recompile.
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
TH3RM4L link said:
Code:
{$CLEO}
0000: NOP

:SAMP
wait 0
if
SAMP.Available()
jf @SAMP
0AC8: 1@ = allocate_memory_size 260
0AC8: 2@ = allocate_memory_size 260

:MAIN
wait 0  
0AB1: call @getChatEntryText 1 ID 98 to 1@
if 
0AD4: $NOT_USED = 1@ format "SMS: [%s >> %s ]:" $NOT_USED 2@
jf @MAIN
0AF9: "/SMS %s TEST" 2@      
goto @MAIN

:getChatEntryText
0AB1: call @GetSampBase 0 1@
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@

:GetSampBase
0AA2: 31@ = load_library "kernel32.dll" 
0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ 
0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
0ab2: ret 1 0@
Code:
[15:32:31] SMS: [Vilius_Andreas >> Ricaradas_Zuisliuis ]:

[15:32:31] test

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x667A242C

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x486DDF

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x486DDF

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x486DDF

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x68636420

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x0

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x0

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x0

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x0

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x0

[15:32:31] Warning(s007): Exception 0xC0000005 at 0x0

Same. I use Sampfuncs 5.1 with Cleo 4.3. The SAMP error report is 0x00000000. Maybe it's because I don't have kernel32.dll in my SAMP directory? I got this working perfectly with numbers and %d, but not strings and %s.
 

silentl747

Active member
Joined
Jul 7, 2014
Messages
96
Reaction score
0
iVilux link said:
Can you explain this further?
That means 0@ is a variable which you can use to diasble thing or make cleo works more easy.

Like a example of this concept:

0@ = SET_PLAYER_BOOM

This mean 0@ is equal to SET_PLAYER_BOOM, Its like shortcuting the text, to make it easy to typed. or you can use 0@ as number variable

For example:
0@ = true
if PLAYER_DRIVER no driving
then
0@ = false
jf Main

Sorry if those codes i used like PLAYER_DRIVEr , Set player boom,  Its just a EXAMPLE. it wont work, you must type the exact opcode.
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
NOPCode.exe link said:
That means 0@ is a variable which you can use to diasble thing or make cleo works more easy.

Like a example of this concept:

0@ = SET_PLAYER_BOOM

This mean 0@ is equal to SET_PLAYER_BOOM, Its like shortcuting the text, to make it easy to typed. or you can use 0@ as number variable

For example:
0@ = true
if PLAYER_DRIVER no driving
then
0@ = false
jf Main

Sorry if those codes i used like PLAYER_DRIVEr , Set player boom,  Its just a EXAMPLE. it wont work, you must type the exact opcode.

And how do I use it as a string variable? I'm new at this 0@ shit.
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
iVilux link said:
And how do I use it as a string variable? I'm new at this 0@ shit.
This is a really stupid question :face_palm: . Just store a string in 0@. Also don't forget to alloc more memory first.
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
TH3RM4L link said:
This is a really stupid question :face_palm: . Just store a string in 0@. Also don't forget to alloc more memory first.

I'm too much of a noob to know how to do that. This should work as an auto reply bot, but I don't know how to store string in variables. What's wrong here?

Code:
{$CLEO}
0000:

:SAMP
wait 0
if
SAMP.Available()
jf @SAMP
0AC8: 1@ = allocate_memory_size 260
0AC8: 2@ = allocate_memory_size 260

:MAIN
wait 0  
0AB1: call @getChatEntryText 1 ID 98 to 1@
if
0AD4: $NOT_USED = 1@ format "SMS: [%s (%d) >> Vilius_Andreas ]:" 2@ $NOT_USED
jf @MAIN
0AF8: "/sms %s this is an automatic reply" 2@
wait 250     
goto @MAIN

:getChatEntryText
0AB1: call @GetSampBase 0 1@
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@

:GetSampBase
0AA2: 31@ = load_library "kernel32.dll" 
0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ 
0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
0ab2: ret 1 0@
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
TH3RM4L link said:
string = text
%s = string
You stored your nickname (a string) in 2@
Get it?

Of course I get it. But!

0AF8: "Hello your name is %s" 0xFFFF00 @2

returns:

"Hello your name is (null)"
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
TH3RM4L link said:
Did you do that?:

Well, when you saw those chatlogs, I realised that if I send an sms, it sends another, and it's an infinite loop. I changed it, but it's (null). Yes, I am always with "as is" because I am often faking screenshots with 0AF8.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
0AD4 can't store strings to @ vars, only to @v.
Code:
0AD4: $NOT_USED = 1@ format "SMS: [%s (%d) >> Vilius_Andreas ]:" 20@v $NOT_USED
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
Then what's wrong here? It still returns "/vaziuoju (null)"

Code:
{$CLEO}
0000:

:SAMP
wait 0
if
SAMP.Available()
jf @SAMP
0AC8: 1@ = allocate_memory_size 260
0AC8: 2@ = allocate_memory_size 260

:MAIN
wait 0  
0AB1: call @getChatEntryText 1 ID 99 to 1@
if
0AD4: $NOT_USED = 1@ format "[racija] Operatore: %s kviečia medikus!  Skambinęs pažymėtas žemelapyje ryskiai raudona spalva." 2@v
jf @MAIN
0AF8: "/vaziuoju %s" 2@v
wait 250     
goto @MAIN

:getChatEntryText
0AB1: call @GetSampBase 0 1@
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@

:GetSampBase
0AA2: 31@ = load_library "kernel32.dll" 
0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ 
0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
0ab2: ret 1 0@
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
0AF8: "/vaziuoju %s" 2@v

Using like this, the compiler will use 2@v as the parameter for color.
Correct way should be;

0AF8: "/vaziuoju %s" 0xFFFFFF 2@v
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
springfield link said:
0AF8: "/vaziuoju %s" 2@v

Using like this, the compiler will use 2@v as the parameter for color.
Correct way should be;

0AF8: "/vaziuoju %s" 0xFFFFFF 2@v

Let me try that. I tried using this before with no luck, trying again now.

Works! Thanks a lot for the help. I am currently editing the script, so if I need any more help, don't lock this thread.
 
Status
Not open for further replies.
Top