lrand is an mpi command that is designed to pull a random string of text from a pre-written list of material on an item. Its usage consists of two parts, filling the variable you will be pulling from, and then pulling from it.

First, you must set a property on the thing you want to use this command, and fill it with data.

Example:

@set THING=THINGLIST1:thing1|thing2|thing3

THING is the DBREF or the item, person or room that you are saving this list in. THINGLIST1 is the name of the list of items. thing1, thing2, and thing3 are the properties. You can have as many of these as you like, but each must be separated by a pipe (One of these | ). The THINGLIST doesn't have to be capitalized, but it should be easy to remember.

Next, you must insert the actual lrand command into the description of whatever you are using it for. In said description, put

{lrand:{prop:THINGLIST1},|}

In this case, THINGLIST1 is the name of whatever your list is.

Now, whenever someone views the description and it gets to this, the description will pull one random item from the list and use that.

EXAMPLE:

Let's say you have an item, the Obnoxiously Loud Shirt (DBref #777) And you want it to shuffle colors every time someone looks at it. You could do something like this:

@set #777=COLORS:plaid|neon pink|red with white polka-dots

@desc #777=This is a shirt that appears to have been designed by someone who is color blind. It is an eye-searing {lrand:{prop:COLORS1},|} and you can't bear to look at it any more.

Now, whenever someone looks at the shirt, it will produce a description that reads "This is a shirt that appears to have been designed by someone who is color blind. It is an eye-searing" and then randomly select a color from the list. It will change every time it is looked at.

MPI: lrand (last edited 2022-06-27 15:16:27 by Mako)