Hi. Please do changes on this cleo. It is a math solver cleo. When its activated after writing /parrot , it solves automatically for the specified seconds. Please someone change it to solve them by specific button like F3. So when i press F3 it will solve the math.
PHP:
{$CLEO .cs}
0000:
repeat
wait 0
until 0AFA: SAMP_IS_READ
0B34: samp register_client_command "parrot" to_label @cmd
while true
wait 0
if 0B61: samp is_local_player_spawned
then
if and
30@ == true // chat text checking was disabled
32@ > 4000 // 2sec passed
then
30@ = false // enable chat checking
32@ = 0 // reset timer
end
// 1@ is regular chat text
// 2@ is text from player nickname, like: Admin_Big: Hello , so it will return sender name: Admin_Big
0AC8: 0@ = allocate_memory_size 1024
0AC8: 1@ = allocate_memory_size 1024
for 0@ = 98 to 99 // 99 is last chat line and 98 is before last, >>>> this will let you read last two chat lines
0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
0AC8: 5@ = allocate_memory_size 1024
0AB1: @delete_color_codes 2 text 1@ memory_to_store_characters_as_text 5@
if and
31@ == true // code is activated
30@ == false // for securety, it will be true after aswer, so it won't work not ganna check chat text
0C29: 6@ = stristr string1 5@ string2 "[REACTION]:" // find match text
then
6@ += 42 // skip first characters
if 0AD4: $NOT_USED = scan_string 6@ format "%d + %d" 7@ 8@
then
005A: 7@ += 8@
0AC8: 10@ = allocate_memory_size 1024
0AD3: 10@ = format "/rt %d" 7@
0209: 9@ = random_int_in_ranges 4000 5000 // generate random time from 2sec till 3sec
wait 9@
0C8F: samp process_chat_input 10@
30@ = true // disable chat text checking
32@ = 0 // reset timer
end
if 0AD4: $NOT_USED = scan_string 6@ format "%d - %d" 7@ 8@
then
0062: 7@ -= 8@
0AC8: 10@ = allocate_memory_size 1024
0AD3: 10@ = format "/rt %d" 7@
0209: 9@ = random_int_in_ranges 4000 5000 // generate random time from 2sec till 3sec
wait 9@
0C8F: samp process_chat_input 10@
30@ = true // disable chat text checking
32@ = 0 // reset timer
end
if 0AD4: $NOT_USED = scan_string 6@ format "%d * %d" 7@ 8@
then
006A: 7@ *= 8@
0AC8: 10@ = allocate_memory_size 1024
0AD3: 10@ = format "/rt %d" 7@
0209: 9@ = random_int_in_ranges 9000 10000 // generate random time from 2sec till 3sec
wait 9@
0C8F: samp process_chat_input 10@
30@ = true // disable chat text checking
32@ = 0 // reset timer
end
if 0AD4: $NOT_USED = scan_string 6@ format "%d / %d" 7@ 8@
then
0072: 7@ /= 8@
0AC8: 10@ = allocate_memory_size 1024
0AD3: 10@ = format "/rt %d" 7@
0209: 9@ = random_int_in_ranges 2000 3000 // generate random time from 2sec till 3sec
wait 9@
0C8F: samp process_chat_input 10@
30@ = true // disable chat text checking
32@ = 0 // reset timer
end
end
end
end
end
:delete_color_codes // from last work snippet, it is no point make same snippet when you can simply just copy paste xD
{
0AC8: 5@ = allocate_memory_size 1024
0AB1: @delete_color_codes 2 text 0@ memory_to_store_characters_as_text 5@
}
5@ = false // inbracket
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 28@ == 123 // start inbracket
then
5@ = true // inbracket
end
if 5@ == false // inbracket
then
0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
1@ += 1 // move to next address
end
if 28@ == 125
then
5@ = false // end inbracket
end
end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0
:cmd
if 31@ == false
then
31@ = true
0AD1: "~W~#Parrot ~N~ ~Y~ ~G~ON" 1337
else
31@ = false
30@ = false
0AD1: "~W~#Parrot ~N~ ~Y~ ~R~OFF" 1337
end
0B43: samp cmd_ret