UOSAGAS Scripting

Macros

Macros are the no-code way to automate: press Record, do the thing in game, press Stop — and Razor can now do it for you, as often as you like. Unlike a simple keypress recorder, every recorded step is a real, editable action.

What macros are

A macro is a list of actions: use an item, cast a spell, say something, target, wait, move an item. The Macros tab shows your macros as a folder tree on the left and the selected macro's actions on the right. Everything you record can be rearranged, edited or extended later — including control flow like loops and conditions that you cannot record at all.

Recording & playback

  • New… creates an empty macro; Record replaces the selected macro's content with what you do next, until you press Stop.
  • Play runs the macro; Loop repeats it until stopped. The status area shows what is currently playing or recording.
  • Bind macros to keys under Hot Keys → Macros.
  • To continue an existing recording instead of replacing it, use Begin Recording Here from the context menu (below) — new actions are inserted after the selected line.

The action context menu

Right-click any action in the list (the click also selects it). While a macro is playing or recording the menu is locked.

  • Reload / Save — reload the macro from disk, or save it.
  • Move Up / Move Down — reorder actions; Ctrl+↑ and Ctrl+↓ do the same from the keyboard.
  • Copy Line / Paste Line — duplicate an action, even into another macro.
  • Remove Action — delete the selected action (asks first; the Delete key works too).
  • Begin Recording Here — continue recording after the selected line.
  • Play From Here — start playback at the selected line, useful for testing the tail end of a long macro.
  • Edit… — edit the selected action (same as double-clicking it).
  • Insert Special Construct — see below.

Actions that support it show extra entries at the top of the menu, just like classic Razor:

  • Edit Timeout… — on Wait for Target / Gump / Menu / Stat / Prompt: how many seconds the wait may block before the macro moves on.
  • Re-Target — on double-click, lift and target actions: pick a new in-game target for the recorded one.
  • Convert To DClick By Type — a recorded double-click stops pointing at one specific item and instead uses any item of the same graphic (a fresh Scribe's pen, the next bandage pile, …). Convert To Lift By Type does the same for lift actions.
  • Convert To Last Target / Target By Type / Relative Location — loosen a recorded absolute target step by step.
  • Edit Amount… — change how much a lift action picks up.
  • Use Last Gump Response / Edit Button ID… — repoint a recorded gump response to the button (and switches) you pressed last.
  • Set Hue… — recolor an overhead message.

Inserting constructs

Everything under Insert Special Construct is inserted after the selected line (with nothing selected it goes to the top). This is how waits and control flow get into a macro, since they cannot be recorded:

  • Wait / Pause… — a dialog offering: pause for N milliseconds, wait for a gump, wait for a menu, wait for a target cursor, or wait for a stat (Hits / Mana / Stamina above or below a value).
  • Set Last Target, Wait for Target, Clear System Messages.
  • Comment… — a free-text line for structuring long macros.
  • Overhead Message… — print a message above your head while the macro runs.
  • If… / Else / End If — the condition dialog covers Hits, Mana, Stamina, Weight, Poisoned, Mounted, empty right/left hand, a received system message, an item counter, or a skill value.
  • For… / End For — repeat a block N times.
  • While… / End While and Do / Do While… — repeat while a condition holds (same condition dialog as If).

Editing actions

Double-click an action (or use Edit…) to change it in place: pause durations and wait kinds, comment text, speech text, overhead messages, For iteration counts and full If/While/DoWhile conditions. Actions that carry a recorded target keep it — see Macro Variables for named, re-bindable targets.

Files & compatibility

Each macro is a plain .macro text file under Data\Macros next to the assistant — the same format Razor CE uses, in both directions. Subfolders appear as folders in the macro tree. Copy files in and out freely; Reload picks up outside edits.

Where to go next

When a macro starts needing more logic than If and While can express, graduate it to a Razor script — or to Lua when you want real data structures and your own UI. Macros, scripts and VScripts all run side by side.