{$CLEO .cs}
0000:
REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY
WHILE TRUE
WAIT 0
IF
0B61: samp is_local_player_spawned
THEN
FOR 0@ = 99 TO 99 // Can be changed to 98 to 99, 97 to 99 - it reads the last amount of lines from the log. In this case, it reads just the last one.
0AC8: 1@ = allocate_memory_size 260
0AC8: 2@ = allocate_memory_size 260
0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
IF
0C29: $NOT_USED = stristr string1 1@ string2 "text" // Text to look for in the chat to start the sequence. It will catch anything that has "text" anywhere in the chat.
THEN
0AF9: samp say_msg "reply" // What you want to say when someone says "text" in the chat.
wait 50
0AF8: samp add_message_to_chat "Success." color 0x000000 // Avoid endless looping by adding a debug message to the chat.
wait 50
END
END
END
END