Quote:
So the code I posted was correct?
No, it wasn't.

Quote:
If so, how come it was spitting out "word found" several times instead of just once? cause the only letter in the word "Chocolate" that matched was the "a" from 'asdf'. Aside from that, it shouldnt have even tested true anyways since the s, d, and f, arent even in %word.
I told you why. The code you used returns true when it finds one letter that matches the requirements. In the example you gave, the letter a matches. So using any combination of asdf would make a match.

Problem with what you want is that if you sort the letters, then you have some words that have the same letters and you have to decide which word to use. Only way I could think of (and I'm not sure if it can be done this way) is to use hash tables. Read in ALL the words and then search for the the words inside of what the person typed. However that wouldn't take care of the rearranging of the letters, only the same order. There might even be a way using regular expressions. But that is all stuff that would be very slow if you don't make use of tools such as $regex (regular expressions) and hash tables for increased speed, otherwise your mirc could spend several seconds, at least, trying to anaylze each sentence to look for words.