Help cleo read from chat and write?

samplover

New member
Joined
Feb 14, 2024
Messages
4
Reaction score
0
How can this be made simply lets say server sends this message "text" and what i want is when this is seen in the chat, not automatically but by pressing a key like F3, to auto write in the chat "text2"
"text" will be the one read from the chat and "text2" to be written in the cleo, and just me by pressing f3 will write "text2". But only when "text" is on the chat.
Purpose is the server has quiz and answers so yeah i do know the answers to it they are always the same repetitive
 

fsociety

Active member
Joined
Dec 6, 2016
Messages
85
Reaction score
5
How can this be made simply lets say server sends this message "text" and what i want is when this is seen in the chat, not automatically but by pressing a key like F3, to auto write in the chat "text2"
"text" will be the one read from the chat and "text2" to be written in the cleo, and just me by pressing f3 will write "text2". But only when "text" is on the chat.
Purpose is the server has quiz and answers so yeah i do know the answers to it they are always the same repetitive
It definitely is possible you can use the event onServerMessage to capture the incoming messages from the server then in the main function you make a loop and listen for the keypress using something like isKeyJustPressed or wasKeyPressed thenyou simply sampSendChat when the conditions are met but then it depends on how many quiz answers there are, if more than one you might need to map them in a dictionary

P.s: this is lua btw
 
Top