An extremely powerful function for filtering targets from the given entities parameter. Depending on the keyword there are several possible outcomes which mimic the MUD's own internal routines for targetting. The keyword may use any of the following formats:
keyword - explicit keyword, all matches returned x.keyword - indexed keyword, 0 or 1 matches returned x*keyword - limitted keyword, at most x matches returned keyw/ - substring match, all matches returned x.keyw/ - indexed substring match, 0 or 1 matches returned x*keyw/ - limitted substring keyword, at most x matches returned
Example:
@targets = %arrayMergeValues( %roomGetItems(), %roomGetMobs() )
// // Example 1, explicit match // @realTargets = %filterKeyword( @targets, "troll" )
// // Example 2, substring match. // @realTargets = %filterKeyword( @targets, "trol/" )
// // Example 3, indexed match. // @realTargets = %filterKeyword( @targets, "3.troll" )
// // Example 4, limitted sibstring match. // @realTargets = %filterKeyword( @targets, "3*trol/" )
// // Example 5, Quan's light bulb. // @realTargets = %filterKeyword( @targets, @argument ) |