Clan Lord Macro Language Reference

Last updated November 11, 2001

One of the most frustrating things about writing macros for CL is that all the information you need is scattered in three or four different places. I've tried to gather it all together in one place, pillaging with great abandon the official macro documentation (which is no longer updated, unfortunately), the works of Phineas (array declarations), Maenygh (how to include subfolders), the "What's New" pages from DT's official CL site, and resources put together by other kind folks too numerous to mention (which just means I've forgotten their names) who have plumbed the depths and reaches of the macro language.

As you might notice, there are no explanations or examples. This is a quick reference for people who know what they want to do but just can't remember the attribute they want to use or who have an idea and want to see if they're going to have to build a hairy workaround or if the macro language already supports what they want to to do.

So here are all the tidbits in one spot. I hope you find them useful. And, of course, if you find something I've left out, please let me know.

Attributes, Variables, Functions:
// This is a comment
@env.debug (true/false)
@env.echo (true/false)
@env.key_interrupts (true/false)
@my.right_item, @my.left_item
call <function>
goto <label name>
include (include ":folder:macrofile" for subfolders)
label <label name>
message "<text>"
message <variable>
pause <number> \" double quote
\' single quote
\r return
\\ backslash

Option Key
option-s "this fails"
option-ß "this succeeds"
OS 9.1 broke option-Fkeys for me. If anyone figures out how to get them to work again, let me know.

if <expression> <comparison> <expression>
else if <expression> <comparison> <expression>
end if

<expression> may be a variable, test, or a number
<comparison> must be from >,<,<=,>=,==,!=
== means equal to
!= means NOT equal to

random <option>
end random
<option> can be "no-repeat"

Set local variable:
set <variable name> <value>
set <variable name> <operation> <value>
<operation> must be + - * / %

Set global variable:
setglobal <variable name> <value>
setglobal <variable name> <operation> <value>
<operation> must be + - * / %

Set with concatenation:
set <string> + <string> concatenates a string

Set an array:
set <variable_name>[<number>] <value>
setglobal <variable_name>[<number>] <value>

Set a two-dimensional array:
set <variable_name>[<number1>][<number2>]

set <variable_name>[<number1>[<number2>]]

Client commands can be used in macros as well. They are:
Using a sewing kit: * Direction is optional and only applies to stand, walkright, walkleft, and attack. It should be one of the following:
Macros can be fired via AppleScript*:
tell application "Clan Lord v115"
     Do Script "ss"
end tell
This script will cause the macro ss to fire in the client.

*Courtesy of Bones