1feb "Programed by Quadir (#9780)@moo.ca, loosely based on a verb by Oblivion (#7951)@moo.ca"; "Simple Verb Grep: "; "grep [l=\"line\"] [r=] "; " 'line' must be surrounded by quotes. Act like they are "; " surounding the line, hence, if there is a quotation "; " mark within the line, use \\\", and so on. "; " The easy rules to figure out how many slashes to use is "; " that you start with one slash, then with each subsequent "; " nested escaped quote, you multiply the previous number of"; " slashes by 2, and add 1 to that sum. "; " is a simple range paramater. Use object numbers "; " or ~ to say #x to #y. Use $ for last possible number. "; " "; "Advanced Greps: "; "grep %1[b=%2][a=%3][o=%4][n=%5][l=\"%6\"][d=%7][c=%8] [r=%9] "; "grep [t=%1][b=%2][a=%3][o=%4][n=%5][l=\"%6\"][d=%7][c=%8] [r=%9] "; " "; "Note: "; " Each section seperated by '[', ']' or ' ' is "; " refered to hereon as an 'arg', and all of them "; " are refered to collectively as the 'arglist'. "; " The order in which each 'arg' is presented in "; " 'arglist' is not relevant. You must be aware "; " that the file grepping done by this program is "; " for Guardians+, and is punishable by MOO Death."; " "; "Defaults: "; " All arguments, are optional. Period. "; " %1 (t) defaults as 'v' "; " %2 (b) defaults as '*' "; " %3 (a) defaults as '*,*,*' "; " %4 (o) defaults as '*' "; " %5 (n) defaults as '*' "; " %6 (l) defaults as '*' "; " %7 (d) defaults as 'nml' "; " %8 (c) not used by default "; " %9 (r) defaults as '*' (.owned_objects) "; " "; "Note: "; " If there is no 'r' argument at the end of "; " arglist, then it is added with defaults. "; " if %1 is not specified at the start, it uses "; " default. All others are initialized to those "; " defaults if not specified. Arg 't' can also be "; " declared by '%1' instead of '[t=%1]'. "; " Also note that you can specify what the arg is "; " for, but putting a (o)bject, (v)erb, (p)rop, "; " (f)ile character, 'oo' would then be an arg for"; " the (o)wner of the (o)bject. After the first "; " choice that follows, the characters in square "; " bracket denote what the arg (or sub-arg) is "; " applicable to, from the types. If it is not "; " specified, then assume that the limitations "; " are on the sub-arguments only. "; " "; "Choices: "; " %1 (t)ype: "; " - 'v', ':' = verbs "; " - 'p', '.' = props "; " - 'f', '!' = files (Guardian+ Only) "; " - 'o', '#' = objects "; " - '*' = all possible types "; " %2 (b)its: "; " - 'r' = readable [ovpf] "; " - 'x' = executable [v] "; " - 'w' = writable [ov] "; " - 'd' = debug [v] "; " - 'o' = overwritable [v] "; " - 'c' = changable [p] "; " - 'f' = fertile [o] "; " - '*' = all possible bits "; " %3 (a)rgs: [v] "; " * = any argument "; " * args not listed here * "; " %4 (o)wners: [vpfo] "; " - #x = object #x "; " - #x~#y = object #x to object #y "; " - #x,#y = object #x and object #y "; " - $ = max_object() "; " - * = any owner "; " %5 (n)ames: [vpfo] "; " - * = any name "; " %6 (l)ines: [vpf] "; " - \"x\" = searches for x in the line "; " - \"x\",\"z\" = searches x in 1st line, z in 2nd"; " - #\"x\" = matches [#..$] of the line "; " - $\"x\" = matches the end of the line "; " %7 (d)isplay: "; " - n = Name of o/p/v/f [opvf] "; " - m = # of line/object [o/pvf] "; " - v = verbs on object [o] "; " - f = files on object [o] "; " - p = props on object [o] "; " - l = lines matches [pvf] "; " - a = args for verb [v] "; " - b = bits [opvf] "; " - o = owner of o/p/v [opv] "; " %8 (c)all: [opvf] "; " - obj:verb = calls obj:verb({arg, arg, ...})"; " %9 (r)ange: [opvf] "; " - #x = object #x "; " - #x~#y = object #x to object #y "; " - #x,#y = object #x and object #y "; " - $ = max_object() "; " - * = .owned_objects "; " "; "Note: "; " (o)bject definitions overide all others. "; " So, if the object doesnt match, it never makes "; " it to any other matching. Remember that you "; " can re-define arguments by specifing them again"; " with a '=' infront. Like: [b==x] "; " The grep will execute every time it runs into "; " a (r)ange argument, or at the end of the "; " arglist, if the last arglist is not a range arg"; " "; "Eval: "; " You can use the '{' and '}' characters to "; " specify an anonymous eval, so that you could "; " do something like: [b={\"x:y(z)\"}] "; " In the eval, the quotes are manditory like in "; " 'l'ine arguments. As well, corresponding arg "; " characters will be substritued as variables. "; " 'p' is used for player (you). "; " "; "Arg Sum, Difference and Equality: "; " You can use '+' and '-' for arguments. If "; " you do not specify when stating an argument, "; " it defaults to '+'. This means that it adds to"; " the argument. Use a '=' to clear it. "; " "; "Examples & Explanations: "; " "; "grep [l=\"x=1\"][r=#0][l=\"x=2\"][r=#1] "; " - searches object #0's verbs for line 'x=1' "; " - searches object #1's verbs for line 'x=2' "; "grep [b=f] "; " - displays a list of all fertile objects "; "grep [c=\"o:is_fertile_for(p)\"] "; " - displays a list of fertile objects for you "; "grep [c=\"o:is_fertile_for(p)\"][r=-#0~#999] "; " - displays a list of fertile objects for you "; " - only displays objects above #999 (so you can"; " create. "; "Backup our argstr"; arglistr = argstr; "For security reasons, clear vars that get passed."; argstr = dobjstr = iobjstr = prepstr = ""; args = dobj = iobj = {}; "Figure out what arg's we have"; arglist = $com_utils:grep_args(arglistr); "Last modified by Quadir (#9780) on Thu Mar 28 00:02:18 2002 MST."; . 0