AKA : Mud

Scripting

Two languages, one client

Write your automation in AKAMud's own TinTin++ / zMUD / cMUD style scripting, or in embedded Lua 5.4. Every alias and trigger chooses its own language. Mix them freely, and both sides share the same variables.

The classic language Lua 5.4 #alias & friends·real Lua·shared variables

Classic scripting

One-liners your fingers already know

Short scripts built from #commands and %functions, in the style of TinTin++, zMUD and cMUD. Type them straight into the command bar or build them in the settings editor; either way they're live immediately, and imported zMUD/cMUD settings run here as they are. Three small steps show how it builds up.

1 - An alias, with what you typed after it

%1 stands for the first word you type after the alias name. Mira hands out a lot of vials:

#alias hv {give healing vial to %1;say Drink up, %1.}
> hv Brannel
give healing vial to Brannel
say Drink up, Brannel.

2 - A trigger that captures with a wildcard

A trigger watches the game's output for a pattern. %w matches a word, and wrapping it in ( ) captures it into %1. Store the capture in a variable and a reply alias writes itself. %-1 means “everything you typed after the alias”:

#trigger {(%w) tells you} {#var lasttell %1}
#alias r {tell @lasttell %-1}
Kelvo tells you, 'Any silverleaf left?'
> r plenty - meet me at the fountain
tell Kelvo plenty - meet me at the fountain

3 - Timers, and a safety net

#alarm +N runs a script once, N seconds from now, independently of whatever you're doing. And a one-line trigger on the game's warning text makes a panic button. #abort stops running scripts on the spot:

#alarm +300 {#echo The herbs should be dry - check the rack.}
#trigger {You are too exhausted} {#abort}

From there it keeps going: regex patterns when wildcards aren't enough, #if and %if for decisions, list and record variables, #wait pacing, TinTin++ spellings like #action accepted as synonyms, and guard rails that stop a runaway loop instead of hanging the client. The full command and function tables ship inside the app: Help ▸ User Guide.

Lua 5.4

A real language, when one-liners aren't enough

Click the Lua chip on any alias or trigger and its script runs as Lua 5.4 instead. Once a script needs real decisions (“if my health is low and I'm not already drinking, then…”), Lua reads far more naturally than a chain of #ifs. Scripts can even define new settings themselves: here a trigger is created with a real function body, and its regex capture arrives in matches[2]:

trigger("goldwatch", "You get (\\d+) gold", function()
  local total = tonumber(getvar("gold") or 0) + tonumber(matches[2])
  setvar("gold", total)
  echo("Purse so far: " .. total .. " gold.")
end)
You get 12 gold coins.
Purse so far: 12 gold.

setvar and getvar read and write the same variables as #var and @name, so the two languages hand values back and forth without ceremony. Timing is just as direct. wait(ms) pauses the script right there and picks up later, while the game keeps flowing:

-- pace a brew instead of spamming it
send("put silverleaf in pot")
wait(2000)
send("stir pot")
wait(2000)
send("drink brew")
echo("Brew finished.")
The sandbox promise. Lua scripts automate your session, nothing else. There is no file, OS, or network access (io, os and require simply don't exist), and an accidental runaway (an endless loop, or a script that allocates without end) is stopped by an instruction budget and a memory limit instead of freezing the client. A script can send commands, print, and manage your settings, and that's the whole of its reach.
Lua editor - Lua 5.4
The AKAMud pop-out Lua editor showing a syntax-coloured script with line numbers and Run, Save and Cancel buttons
The pop-out Lua editor: syntax colouring, line numbers, and a Run button that sends the whole script to your live session to try before saving.

Choosing

Which should I pick?

Whichever reads better for the job in front of you. The choice is per alias and per trigger, never per character.

You want to…Reach for
Shorten a command, react to a line, set a timerClassic: one line and it's done.
Run settings imported from zMUD or cMUDClassic: they run as they are, no translation.
Make real decisions: “if this and not that…”Lua: reads better than chained #ifs.
Write longer routines with functions and local stateLua: it's a real programming language.
Have both, side by sideMix freely: per item, and both share the same variables.

The full reference ships with the app

This page is the taster. Every #command, %function and Lua API call is documented in the User Guide bundled with AKAMud; open it any time with Help ▸ User Guide. Or see everything else AKAMud does.

Download AKAMud