Search()

From TinyMUX
Jump to navigation Jump to search

Description

FUNCTION: search ([<player>] [<class>=<restriction>[,<low>[,<high>]]])

The search() function returns a list of objects that match the search criteria, which are the same as with the @search command. This function costs as much as the @search command, so repeated use is expensive. Caution: if you use the [ and ] characters in an Eval selection you will need to escape them.

PennMUSH's search() function (An alias of lsearch()) has a different interface and is not compatible with the MUX form.

Related Topics: @search, SEARCH CLASSES.

Examples:

> say search()
You say, "#226 #289 #325 #364 #368 #369"
> @stats me
6 objects = 0 rooms, 0 exits, 5 things, 1 players. (0 garbage)
> say search(eval=\[eq(money(##),1)\])
You say, "#289 #325 #364 #368 #369"
> say search(player=wizard)
You say, "#1"