@clone

From TinyMUX
Jump to navigation Jump to search


@clone creates an exact duplicate of an object.

Description

 COMMAND: @clone <object, room, or exit>[=<new name>]
          @clone/preserve <object, room, or exit>[=<new name>]

For objects, creates an exact duplicate of it and puts it in the current room. For exits, it creates an exact duplicate of that exit, except the clone's source is the current room rather than whatever the original exit's source was. For rooms, creates an exact duplicate of the room, without contents or exits. The name of the duplicate object can be provided; it defaults to the same as the name of the original object.

The thing to be cloned must be controlled by the @cloning player. The clone will be owned by the @cloning player.

If creation times are enabled, a clone will have a different creation time than the object it was cloned from, but will have the same modification time, to make tracking revisions of code easier.

A wizard may use @clone/preserve, which has the effect of preserving all the bits, powers, and warnings of the original object.

Example

   To clone a room and all its exits, use code like: 
   > @tel [setq(0,%l)][clone(here)]; @dolist lexits(%q0)=@clone ##

See also: @create