? in the location means private message.
The first * right after on is necessary, though you could optionally make it a 1. It refers to the level of user who can trigger the event. In most cases, you want it to be triggered by anyone. If you wanted to limit who can trigger it, you can add users to the Users tab with different levels and you could put a level there instead of * or 1 and only those with that level (or higher if it's a numeric level) will trigger it. For what you're doing, just use * or 1.
The other *'s are wildcards. It means that anything can be in that location and it will work. For example, *do you have any*dollars* would trigger on any of the following (some aren't grammatically correct, but are just used for examples):
Helen, do you have 5 dollars?
Do you have 435 dollars?
Do you have any dollars?
Do you have some dollars? Can I have some?
If you want it to trigger only on a specific phrase, you can remove them. For example, do you have 5 dollars? will only trigger on:
Do you have 5 dollars?
It will not trigger on anything else, including if someone just put 2 question marks instead of one.
Note that it's case insensitive, meaning it doesn't matter if it's capital or lowercase.
You'll need to determine what kind of wildcards you need or don't need based on what you want to match. There are many tutorials on wildcard use for matchtext on the internet and any of them will help even if they aren't specifically for mIRC. Just note that * means anything from 0 to infinite number of characters at that location. Also note that without a * in front, if someone types it in color, it won't match because the control codes for colors count as part of the matchtext. The * allows someone to type it in color and still trigger the event. That being said, if someone did each letter a different color, it would not match. If you think you need to match something like that, you'd want to look into using $strip() and placing the matchtext into an IF statement and just putting * in the event's matchtext spot. You probably don't have to worry about that, though.
There are a variety of things you can do, including using regex, but this is a good place to start.