You would need to register for the
CHAT_MSG_CHANNEL event. When it fires, check its arguments to find out if the received message is in a channel you care about (the
channelNumber argument), and then loop over your table of messages and check the received message (the
message argument) against each one. If you find a match, set your variable.