Skip to content

@cpattr

@cpattr[/noflagcopy] <obj>/<attr>=<obj1>[/<attr1>][, ..., <objN>[/<attrN>]]
@mvattr[/noflagcopy] <obj>/<attr>=<obj1>[/<attr1>][, ..., <objN>[/<attrN>]]
@cpattr[/noflagcopy] <obj>/<attribute pattern>=<obj1>[, ..., <objN>]
@mvattr[/noflagcopy] <obj>/<attribute pattern>=<obj1>[, ..., <objN>]

@cpattr copies the <attr> attribute from <obj> to <obj1> (and any other objects given). By default, the new attributes will have the same name as the original, but you can specify a different name to be used on each object if you wish.

@mvattr works the same, but also attempts to remove the original attribute after copying it.

Attribute flags are copied as well, unless the /noflagcopy switch is given. This is recommended when copying from a non-standard attribute to a standard one. The /convert switch is accepted and changes nothing.

> @cpattr box/test=box/test1, cube/random, tribble/describe

would check the object “box” for an attribute named TEST and then copy it to the attributes TEST1 on “box”, RANDOM on the object named “cube”, and DESCRIBE on the object named “tribble”.

> @cpattr box/test=cube

would copy the TEST attribute from “box” to TEST on “cube”.

When <attr> is a wildcard pattern (see wildcards), every attribute of <obj>’s own that matches it and that you can see is copied, each under its own name, so each destination names only an object. PennMUSH copies one attribute at a time; patterns are a SharpMUSH addition.

> @cpattr box/CMD`**=cube

Output: one “Attribute <name> copied to 1 destination.” line for each attribute under CMD on “box”. Each copy on “cube” has the same name as its original.

::: seealso