User:Luke/Code/Basic Attribute Manipulation
All commands specified in blockquotes beneath are to be entered literally as they appear.
Sets the attribute "name" on yourself to "value". Literally. Embedded Mushcode functions will not be evaluated.
Sets the attribute "name" on yourself to "value". Embedded Mushcode functions will be evaluated.
@set me=thetime:[time()] think time() think [time()]
Try these chunks of code to get a feeling of what mushcode functions do. Now for a little bit of recursion:
@set me=foo:bar think [get(me/foo)] @set me=foo:more [get(me/foo)] ex me/foo think [get(me/foo)]
Typing the above block into your mushclient should show you how the get() function works; more information is available in help get().
A practical application
@set me=wave:Hello,%r @set me=wave:[get(me/wave)]I wanted to say Hi.%r @set me=wave:[get(me/wave)]Greetings,%r @set me=wave:[get(me/wave)]me. ex me/wave think %N +wave %N=Subject/[get(me/wave)]
Try it. %N typically evaluates to the name of the object that is using the command. This is in this case you. I use this so the wave is sent to yourself and you can see it.