While working lightly on a LPMUD(TMI-2) specifically, I thought of writing something to search for emotes, much like the apropos command will search for functions that match a string you input to it.
So you would do: emoteapropos <whatever string>, and it would take your string and search all the emotes/temotes(souls on some muds) and return any emotes with matching content.
Emotes on the mud are stored in a mapping, but I have sorts that return all the keys of the emotes in a large array and vice versa for the values of the mapping.
My problem lies in several places, I can't figure out how to search an array with the inputted string from the user to even return whether or not their search would have found any matching emote. I also am not sure how I would have it return the key(name of the emote, first value in the mapping) if the inputted string from the user matched a value or values of one of the emotes.
Anyone think they can help me with this, or have actually done it, i'd appreciate a helping hand or more.
|