I'm trying to make a simple script (for my first time) that will show how many times I have recieved a message with "Nick" in it... but at the moment I only know how to get it to check if the whole message is Nick...
How would i change it so that if any part of the message contained "Nick" then it would update the count?
Current Code:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Sender, ChatMsg, ChatType)
{
if (ChatMsg == "Nick") {
Nick = Nick + 1;
Debug.Trace("Added one to count.");
ChatWnd.SendMessage("The Nick Count is now at: " + Nick);
}
if (ChatMsg == "nick") {
Nick = Nick + 1;
Debug.Trace("Added one to count.");
ChatWnd.SendMessage("The Nick Count is now at: " + Nick);
}
}