Try using the following regular expression (select the Regular Expression box):
^(\w+) gives you ((\w+)(?: .*)?)$
Short explanation:
^ means beginning of line.
(\w+) means one word of one or more characters which is captured with () into %1.
(...) captures the stuff inbetween into %2
(\w+) same as above, for %3.
(?: .*)? optionally takes the remainder of a line.
$ means end of line.
You can use that in combination with:
c bless %2
give %3 %1
This way, the bless-cast will still use the full item name.
There's a problem with the above. It will end up sending "give red bob". The problem with making a trigger is knowing where the noun is. How can we systematically deduce if bob's giving you a "red apple" or "sword of slaying"?
I'd suggest seeing if your mud have a more verbose way to give things. i.e. "give red apple to bob"
Ok well it was simpler than i thought when i worked it out.
Unfortunately the MUD doesn't recognise the item with " around it, but what i did was this
* gives you * * *
c bless %3
give %3 %1
The 1st * is obviously the person's name, the second 1 picks up a an the some etc..... the third picks up the 1st word in the items short description, but because there is a fourth (which i don't use) it doesn't pick up the rest of the short desc.
This isn't perfect, as some items has a short desc format that doesn't fit, and some items don't have the 1st word in the short desc as a keyword, but it works for 95% of the stuff i need to use it on. What i'm doing is producing a list of items, as and when they come up, that don't have the 1st word as a keyword, and making a trigger just for them, which should in time pick them all up.
Thanks all
EDIT
Ok slightly new problem - I knew from the start that their would be items that wouldn't work, as the 1st word in their short desc wouldn't be a keyword. My plan was that when I came across these I would make a trigger for each.
EG
Bob gives you a red apple - Doesn't work if the red apple doesn't have red as a keyword.
There are only a few of these so what i would do is, when i find one make a trigger for it individually. Rather than using:
* gives you * * *
I would use
* gives you a red apple.
and then gave the output as give %1 apple.
These are all obviously made by hand, to get around the problem of the short desc not matching the keyword. The problem i'm having is that the original trigger runs, not the new one i've made specifically for that item, as it still matches the criteria with the wild cards. Is there anyway to make it so that the individual triggers for unsual items take prescedence over the general all purpose one?
Yes, there is. It's very easy. In the trigger dialog box(as well as the aliases) there is a box labeled 'sequence' this is the priority of the trigger, the lower the number the earlier it'll be checked, so just change the sequence number to something lower than that of your general trigger. Like 99 for example. You can put all the custom triggers at 99 and as long as the general one is at 100, the custom ones will be checked first, and as long as you don't have 'keep evaluating' checked it will stop with the first one that matches. Alternatively you could just raise the sequence number of the general trigger.