Sure. There are lots of examples in the Macro Instructions file, of
course, but they're buried in documentation some may find intimidating.
Here are some more examples and (hopefully) simpler explanations:
----------------------
Basic typing shortcuts
----------------------
Put the macro name in double quotes, or the name of the key, like before.
Then on the same line, list everything you want it to say. Nothing that
isn't in the macro you define will be entered in. If you want the text
you type to be included, put in @text. If you want it to hit return at
the end, add "\r". (That's a bit of a change from before.)
shift-f1 "/action waves.\r"
"aa" "/action " @text "\r"
"th" "/thank " @splayer " " @text "\r"
"sit" "/action sits down.\r/pose sit\r"
@text is whatever you have typed in, other than the macro name itself and
a space after it (I think). @splayer is the name (no spaces or
punctuation) of the person you have selected. So with that third macro,
if I select AlthePal and type
th for being a nice guy.
it'll be entered in as
/thank AlthePal for being a nice guy.
First "/thank ", then the selected player's name, then a space, then what
I typed after the macro name and space, and finally a return.
-----------------------------
Macros with multiple commands
-----------------------------
There are a couple of kinds of commands. Typing any amount of text all at
once (including things that hold text, like @text and @splayer) is one
command. There are also commands for pause, equip, unequip, move, and
random. (Also fancier ones that I won't get into here.) If you want a
macro to have more than one command, you have to use curly brackets { } to
enclose them all.
"fight"
{
"/action readies for combat.\r"
"/equip axe\r"
pause 2
"/equip shield\r"
}
This is just like a whole series of the single-command macros above. You
can give multiple-command macros names or keys, and you can list as many
commands in each as you want.
-------------
Random macros
-------------
One of the commands is "random". It's complicated enough, and common
enough, that it deserves a section of its own. Here's a simple example:
"hi"
{
random no-repeat
"Hi there!\r"
or
"Hello!\r"
or
"Nice day, isn't it!\r"
or
"/action waves cheerily.\r"
end random
}
This macro chooses one of the four options and types that text. The
"no-repeat" means that it will never choose the same option twice in a
row. Let's look at a more complicated random example:
"nap"
{
random
"/action lies down to nap.\r/pose lie\r/sleep\r"
pause 10
"/ponder This axe isn't a very comfortable pillow.\r"
or
"/unequip right\r"
"/action meditates peacefully.\r/pose kneel\r/sleep\r"
or
"/action falls asleep on his feet.\r/sleep\r"
pause 15
"/ponder Zzz...*gsnorrrk*\r"
end random
pause 20
"Ah, that was a nice nap.\r"
}
This starts out by randomly choosing one of three naps: lying down,
kneeling, or standing up. Whichever one it chooses, it does all the
commands in that chunk, until it gets to the next "or" command. Then it
skips everything up to "end random", and continues on with the rest of the
macro, in this case pausing for about 5 seconds (20 frames) and then
talking about the nap.
------------------
Replacement macros
------------------
This is a different kind of macro. It's meant to expand abbreviations
inside whatever you're typing. Replacement macro names are marked by
single quotes instead of double quotes. They expand as you type, when the
macro name (abbreviation) is followed by a space or return.
'DT' "Dark Temple"
'OC' "Orga Camp"
'thx' "thank you!"
With these, I can type
You helped me in the OC and I hardly know how to thx
and it will come through as
You helped me in the Orga Camp and I hardly know how to thank you!
If you want to type an abbreviation followed by a space or return, but for
some reason you *don't* want it to expand out, hold control as you type
the space or return. For example, if you're talking to someone in the
fairgrounds, you might want to say
You can get the update from the DT Web page.
To have that come through as "DT" instead of "Dark Temple", hold down
control as you type the space right after "DT".
Like the other kind, replacement macros can be random:
'bye'
{
random
"Farewell, "
or
"Bye-bye now, "
or
"See you later, "
end random
}
Now if I type
bye friends!
I'll get either "Farewell, friends!" or "Bye-bye now, friends!" or "See
you later, friends!", chosen randomly. You can't put a pause, equip, or
unequip in a replacement macro.
---------------
Including files
---------------
You might want some of your macros to be used with more than one
character. You can put them all in one file, and use that file in each
character's own macro file. The file called "Default" is automatically
included in every character's macro file, but you can take it back out if
you want. If the same key or macro name is defined twice, maybe once in a
general file and once in this character's file, the one encountered
*first* will be used, and you'll get a warning when you connect. You can
ignore that error message if it's what you meant to do. For instance, you
might have
include "Sylvan Words"
include "Default"
If the "Default" file has a general macro for "hi" for most of your
characters, and "Sylvan Words" has a different "hi" macro for the three
Sylvans you play :), this lets the Sylvans say "H'loi" when the rest of
the gang says "Hello".
-------
Echoing
-------
Normally, when a macro is used it appears expanded in your input area,
instead of having only what you actually typed show up there. To change
that, put this at the top of your macro file:
set @env.echo false
The opposite, of course, is
set @env.echo true
-----------------
Reference section
-----------------
There are a lot more complicated things in the macros, which you can read
about in the Macro Instructions. You can define subroutines, set
variables, check conditions, make loops, assign macros to clicking, and
even send yourself a message. I won't talk about any of those here. But
I will list the simple automatic variables and commands I've already
referred to.
Variables
@text - whatever you typed in, except for the macro name and a space
@textsel - the text you have selected when the macro starts
@my.name - your character's name
@selplayer.name - selected player's name (no spaces or punctuation)
@selplayer.name - selected player's name (with spaces and punctuation)
@my.right_item - name of what you're holding in your right hand
@my.left_item - name of what you're holding in your left hand
Commands
pause
random
or
end random
set @env.echo false
set @env.echo true
Whew, there you go. Hope that helps!