Skip to content

EU AutoLoad

Codex edited this page Sep 19, 2026 · 6 revisions

AutoLoad and macros

Home · BASIC · UO API · A–Z · Examples · Languages

Directory layout

Autoload\
├─ autoload.sc
├─ MyCombat.inj
├─ Crafting.bas
└─ Scripts\
   ├─ Healer.sc
   └─ Hunter.sc

The root of Autoload is reserved for AutoLoad files and the Scripts directory. Supported AutoLoad extensions are .sc, .inj, .bas and .txt; the base name is unrestricted. Ordinary IDE scripts belong in Autoload\Scripts.

Select the active AutoLoad

  1. Open Options → Basic IDE.
  2. Choose a file in the AutoLoad field.
  3. Press Apply.

The selection is stored per character in YokoAutoloadFile; its default value is autoload.sc. On entering the game scene, Runtime loads only the selected file and starts its SUB Main(). Other files in the directory do not start automatically.

Basic Auto Load macro action

In Options → Macros → Classic, Basic Auto Load reads procedures from the selected AutoLoad, displays them in its procedure list, and lets a procedure be assigned to a key or button. Activating the binding executes that procedure through the shared Basic Runtime. Changing the character or its selected AutoLoad changes the available list.

Basic Example macro action

Basic Example stores a complete small script inside the normal macro profile. The editor uses a readable dark theme with light text, a visible caret and selection.

SUB Main()
    UO.Print('Example macro')
END SUB

To use it:

  1. add Basic Example to a macro;
  2. open its source editor;
  3. write code between SUB Main() and END SUB;
  4. assign the macro to a key;
  5. save the profile;
  6. press the key to execute this separate script through Runtime.

The example is stored with ordinary profile bindings, not as an extra file in the Autoload root. It does not replace the selected AutoLoad.

Saving from Basic IDE

  • a new unnamed document saved normally goes to Autoload\Scripts;
  • a file opened from disk is saved back to its original path;
  • Save All writes all modified documents;
  • the IDE asks to save unsaved source before execution.

The IDE does not automatically create top-level AutoLoad files. Organize and select those files explicitly.

Avoiding client stalls

Macro execution is submitted to the managed Runtime queue, and game-thread work is kept short. A script must also yield cooperatively. Put UO.Wait(...) in repeated loops and divide expensive operations into small steps. Do not use an active infinite loop.

Minimal AutoLoad example

SUB PrintStatus()
    UO.Print('HP: ' + CStr(UO.GetHP()))
END SUB

SUB Main()
    UO.Print('Selected AutoLoad started')
END SUB

Main starts on entry to the game scene. PrintStatus can be selected by Basic Auto Load if it appears in the procedure list generated from this file.

Clone this wiki locally