CLEO Help Auto Read and Answer

CLEO related

Larson

New member
Joined
Apr 24, 2021
Messages
4
Reaction score
0
Location
Serbia
Hello there and sorry for my bad english

I was looking for autoanswer cleo that reads the chat and automaticly sends respond to the answer
I need specific cleo for ID reading

There is a system on the gamemode when player asks for help it says [Name] question: i need helper! (/ahelp ID of the player) so the admin have to type /ahelp and ID to teleport to the player
I need CLEO that automaticly answers that and a command /autoanswer so i can set the delay for example 2.0 3.0 seconds etc....
Im newbie so i dont really know even if this is possible but if someone have this cleo please help me :)
 

Larson

New member
Joined
Apr 24, 2021
Messages
4
Reaction score
0
Location
Serbia
sure , say more about ur sytem
There is a system when player asks for help admins get a message for example

John_Peterson[ID: 92] question: i need helper! [/ahelp 92]
So the admin have to type /ahelp and player's ID (in this case 92) to accept the help request
I need a script that does that automaticly when i press some key or type some command whatever
and also a command to set the delay for example 2 , 3 secconds so it cant be noticed by others administrators
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
There is a system when player asks for help admins get a message for example

John_Peterson[ID: 92] question: i need helper! [/ahelp 92]
So the admin have to type /ahelp and player's ID (in this case 92) to accept the help request
I need a script that does that automaticly when i press some key or type some command whatever
and also a command to set the delay for example 2 , 3 secconds so it cant be noticed by others administrators

Fallowing this part...:
PHP:
John_Peterson[ID: 92] question: i need helper! [/ahelp 92]

Code made.:
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

0B34: samp register_client_command "autohelp" to_label @cmd

while true
wait 0

if and
31@ == true 
0B61:  samp is_local_player_spawned
then
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    0AC8: 4@ = allocate_memory_size 1024
    0AB1: @changeString 4 text 0@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 4@
    if 0C29: 5@ = stristr string1 4@ string2 " [/ahelp"
    then
        0AC8: 6@ = allocate_memory_size 260
        0AB1: @get_digits_to_print 2 text 5@ memory_to_store_digits_as_text 6@
        say "/ahelp %s" 6@
        wait 1500 // anti spam
    end    
end

end

:changeString
{
    0AB1: @changeString param_count 4 text 0@ FirstCharacter 91 SecondCharacter 93  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text

}
5@ = FALSE // inbracket
0C17: 31@ = strlen 0@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end
 
        if
        5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 3@ size 1 value 28@ virtual_protect 1
            3@ += 1 // move to next address
        END
 
        if
        003B:   28@ == 2@  // (int)
        then
            5@ = FALSE // inbracket
        end
    end
0A8C: write_memory 3@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}
0C17: 31@ = strlen 0@
    for 30@ = 0 to 31@  
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if and
        28@ >= 0x30 // '0'
        28@ <= 0x39 // '9'
        then
        0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
        1@ += 1 // move to next address
        end
    end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination 
0AB2: ret 0

:cmd
if 31@ == false
then
    31@ = false
    0AD1: "on" 1337
else
    31@ = true
    0AD1: "off" 1337
end
0B43: samp cmd_ret
 

Larson

New member
Joined
Apr 24, 2021
Messages
4
Reaction score
0
Location
Serbia
Fallowing this part...:
PHP:
John_Peterson[ID: 92] question: i need helper! [/ahelp 92]

Code made.:
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

0B34: samp register_client_command "autohelp" to_label @cmd

while true
wait 0

if and
31@ == true
0B61:  samp is_local_player_spawned
then
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    0AC8: 4@ = allocate_memory_size 1024
    0AB1: @changeString 4 text 0@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 4@
    if 0C29: 5@ = stristr string1 4@ string2 " [/ahelp"
    then
        0AC8: 6@ = allocate_memory_size 260
        0AB1: @get_digits_to_print 2 text 5@ memory_to_store_digits_as_text 6@
        say "/ahelp %s" 6@
        wait 1500 // anti spam
    end   
end

end

:changeString
{
    0AB1: @changeString param_count 4 text 0@ FirstCharacter 91 SecondCharacter 93  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text

}
5@ = FALSE // inbracket
0C17: 31@ = strlen 0@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end

        if
        5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 3@ size 1 value 28@ virtual_protect 1
            3@ += 1 // move to next address
        END

        if
        003B:   28@ == 2@  // (int)
        then
            5@ = FALSE // inbracket
        end
    end
0A8C: write_memory 3@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}
0C17: 31@ = strlen 0@
    for 30@ = 0 to 31@ 
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if and
        28@ >= 0x30 // '0'
        28@ <= 0x39 // '9'
        then
        0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
        1@ += 1 // move to next address
        end
    end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:cmd
if 31@ == false
then
    31@ = false
    0AD1: "on" 1337
else
    31@ = true
    0AD1: "off" 1337
end
0B43: samp cmd_ret
Local variable 31 is out of range. Max variable is 17@.

I get this error for this code
31@ == true
 
Top