Any help for this amateur scripter will be much appreciated...
Kind of for practice, I'm testing a simple script where certain words in a message are automatically replaced by other words. (You know, just like the Quick Text function in Messenger Plus!)
So I got the replacing function down, but I can't seem to figure out, with my limited intelligence, how to make it so that it replaces whole words only.
so for example-
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if (Message.search("Whatever") !== -1)
return Message.replace("Whatever","Test")
}
so now how do I make it so that the script only replaces "Whatever" with "Test" if "Whatever" is a whole word. Like, so "Whateverasfkl" wouldn't become "Testasfkl"? I've thought that perhaps it's using the split() string (Message.split(" "), but for all I'm worth I can't figure it out.