CLEO Help Auto command after reading from chat CLEO

CLEO related
Status
Not open for further replies.

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
[shcode=cpp]
{$CLEO .cs}

0000:

wait 10000

0B34: samp register_client_command "redeem" to_label @cmd

while true
wait 0
FOR 0@ = 98 TO 99

if
31@ == true
then
0AC8: 2@ = allocate_memory_size 260
0AC8: 1@ = allocate_memory_size 260
0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
if
0AD4: $NOT_USED = scan_string 0@ format "You have earned %d credits! do /redeemcreds %d" $NOT_USED 5@
then
say "/redeemcreds %d" 5@
end
end

END // END FOR 0@ = 98 TO 99
end

:cmd
if
31@ == false
then
31@ = true
chatmsg "Auto redeemcreds ON" -1
else
31@ = false
chatmsg "Auto redeemcreds OFF" -1
end
0B43: samp cmd_ret

[/shcode]
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
[shcode=cpp]
{$CLEO .cs}

0000:

repeat
wait 0
until 0afa:

0B34: samp register_client_command "redeem" to_label @cmd

while true
wait 0
FOR 6@ = 98 TO 99
0AC8: 0@ = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
0AB1: @GETCHATENTRYTEXT 1 id 6@ to 0@ // THIS IS A FUNCTION THAT STORES THE LAST CHAT STRING INTO 0@
   
if
31@ == true
then
   if
   0AD4: $NOT_USED = scan_string 0@ format "You have earned %d credits! do /redeemcreds %d" $NOT_USED 5@
   then
       say "/redeemcreds %d" 5@
   end
end

END // END FOR 0@ = 98 TO 99
end


:cmd
if
31@ == false
then
   31@ = true
   chatmsg "Auto redeemcreds ON" -1
else
   31@ = false
   chatmsg "Auto redeemcreds OFF" -1
end
0B43: samp cmd_ret

: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@
[/shcode]
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
001 said:
Parazitas said:
[shcode=cpp]
{$CLEO .cs}

0000:

repeat
wait 0
until 0afa:

0B34: samp register_client_command "redeem" to_label @cmd

while true
wait 0
FOR 6@ = 98 TO 99
0AC8: 0@ = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
0AB1: @GETCHATENTRYTEXT 1 id 6@ to 0@ // THIS IS A FUNCTION THAT STORES THE LAST CHAT STRING INTO 0@
   
if
31@ == true
then
   if
   0AD4: $NOT_USED = scan_string 0@ format "You have earned %d credits! do /redeemcreds %d" $NOT_USED 5@
   then
       say "/redeemcreds %d" 5@
   end
end

END // END FOR 0@ = 98 TO 99
end


:cmd
if
31@ == false
then
   31@ = true
   chatmsg "Auto redeemcreds ON" -1
else
   31@ = false
   chatmsg "Auto redeemcreds OFF" -1
end
0B43: samp cmd_ret

: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@
[/shcode]

It works, but i need it always on.
 
You know what is 31@ == true ?
That is loop , loop mean it's always on until you off..
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
001 said:
Parazitas said:
001 said:
Parazitas said:
[shcode=cpp]
{$CLEO .cs}

0000:

repeat
wait 0
until 0afa:

0B34: samp register_client_command "redeem" to_label @cmd

while true
wait 0
FOR 6@ = 98 TO 99
0AC8: 0@ = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
0AB1: @GETCHATENTRYTEXT 1 id 6@ to 0@ // THIS IS A FUNCTION THAT STORES THE LAST CHAT STRING INTO 0@
   
if
31@ == true
then
   if
   0AD4: $NOT_USED = scan_string 0@ format "You have earned %d credits! do /redeemcreds %d" $NOT_USED 5@
   then
       say "/redeemcreds %d" 5@
   end
end

END // END FOR 0@ = 98 TO 99
end


:cmd
if
31@ == false
then
   31@ = true
   chatmsg "Auto redeemcreds ON" -1
else
   31@ = false
   chatmsg "Auto redeemcreds OFF" -1
end
0B43: samp cmd_ret

: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@
[/shcode]

It works, but i need it always on.
 
You know what is 31@ == true ?
That is loop , loop mean it's always on until you off..
i mean always on without the /redeem command

Rly..., so hard delete part of command???

[shcode=cpp]
{$CLEO .cs}
 
0000:
 
repeat
wait 0
until 0afa:
 
while true
wait 0

FOR 6@ = 98 TO 99
0AC8: 0@ = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
0AB1: @GETCHATENTRYTEXT 1 id 6@ to 0@ // THIS IS A FUNCTION THAT STORES THE LAST CHAT STRING INTO 0@ 
    
if
0AD4: $NOT_USED = scan_string 0@ format "You have earned %d credits! do /redeemcreds %d" $NOT_USED 5@
then
    say "/redeemcreds %d" 5@
end // end 0AD4: $NOT_USED = scan_string 0@ format "You have earned %d credits! do /redeemcreds %d" $NOT_USED 5@ 
 
END // END FOR 0@ = 98 TO 99

end // end while true
 

: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@
[/shcode]
 

001

Active member
Joined
Jun 28, 2017
Messages
25
Reaction score
0
@Parazitas
This is what happens.. we need it to do the command just 1 time when this "You have earned 10 credits! do /redeemcreds %d" text appears
cKuwGU7.png
 
Status
Not open for further replies.
Top