First let me make sure that I understand what you're looking for:
Joe gossips Hitter wanted sanc e n.
should result in
sanc e n
being send to the mud by you. Alternatively,
SomeotherJoe gossips I need two hitters sanc e n.
should result in the same response.
As I understand this, you are a "Hitter," so when people request you on gossip, you're trying to do what they ask you to do.
At the most basic level, this is done with two triggers:
#TRIGGER {^%w gossips Hitter wanted (*).$} {#SEND %1}
#TRIGGER {^%w gossips I need {two|2} hitters (*).$} {#SEND %1}
Clearly this leaves some big security holes, since...
SomeIdiot gossips Hitter wanted gossip I'm really stupid.
...will result in you looking like an idiot.
To address this, you can do a couple of things. The first is limit whom you'll respond to.
#VAR trustedFriends {NiceGuy|SwellGuy|NeatoGuy}
#TRIGGER {^{@trustedFriends} gossips Hitter wanted (*).$} {#SEND %1}
#TRIGGER {^{@trustedFriends} gossips I need {two|2} hitters (*).$} {#SEND %1}
Now you will only respond when NiceGuy, SwellGuy or NeatoGuy do the gossiping. You will not respond to anyone else.
Another layer of protection would be some list of viable commands.
#VAR trustedFriends {NiceGuy|SwellGuy|NeatoGuy}
#VAR commandList {sanc e n|some other thing|etc}
#TRIGGER {^{@trustedFriends} gossips Hitter wanted (@commandList).$} {#SEND %1}
#TRIGGER {^{@trustedFriends} gossips I need {two|2} hitters (@commandList).$} {#SEND %1}
You've now lost a lot of flexibility, but have a lot more control over what they can make you do.
Now.. something I've been ignoring is that I think
Joe gossips Hitter wanted sanc e n.
should result in
sanc
e
n
being send to the mud by you. Now the commands are separated. The previous triggers did not do this. In order to do this, we need to revert back to the * operator and do some string manipulation.
#VAR trustedFriends {NiceGuy|SwellGuy|NeatoGuy}
#VAR commandList {sanc e n|some other thing|etc}
#TRIGGER {^{@trustedFriends} gossips Hitter wanted (*).$} {processCommand %1}
#TRIGGER {^{@trustedFriends} gossips I need {two|2} hitters (*).$} {processCommand %1}
#ALIAS processCommand {#FORALL (%replace(%1," ","|")) {#IF (%ismember(%i,@commandList) {#SEND %i} {#SHOW Invalid command requested: %1. If this should be valid, add it to the commandList variable.}}}
Notice that since I don't want to repeat code, I've pulled it out and shared it in the alias. The first thing I do is replace all spaces with '|' characters. This essentially turns the string into a string list parsed into elements separated by spaces.
Once I have a string list, I iterate through it and for each element in the list, send the command if it's a valid command (in commandList).
This doesn't allow for multi-word commands, but I'll leave that as an exercise for you. :)
I hope this helps. Let me know if I'm still not getting what you're looking for.
Wil
P.S. This code has NOT been tested, but take it with a grain of salt. If it doesn't work, let me know what errors you get. :)
Wil Hunt