Every ClassicUO Web script starts with a set of global variables and built-in functions already in scope. You never need to import anything —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ClassicUO/classicuo-web/llms.txt
Use this file to discover all available pages before exploring further.
player, client, journal, and the rest are injected automatically before your script runs. This page documents all of them, along with the three built-in functions (sleep, log, and exit) that control timing, output, and flow.
Global Variables
The table below summarises every pre-injected variable. Each one is a live reference to the current state of your game session — reads always reflect the latest values at the moment they are evaluated.| Variable | Type | Description |
|---|---|---|
client | Client | Main object for interacting with the ClassicUO client and the game world. |
player | Player | Reference to the currently logged-in player character. |
journal | Journal | Inspect and search entries from the in-game text journal. |
ignoreList | IgnoreList | Manage entities that should be excluded from search functions. |
target | Target | Create targeting cursors and respond to targeting requests. |
worldMap | WorldMap | Read and manage markers on the world map. |
popupMenu | PopupMenu | Interact with context menus (right-click popup menus) on entities. |
client
client is the main entry point for interacting with the ClassicUO client and the game world. Use it to search for nearby entities, send commands, query world state, and perform actions that are not tied directly to your character.
player
player is a direct reference to your character. It exposes stats, skills, position, equipment, and action methods such as useSkill(), say(), and move().
journal
journal lets you inspect the rolling log of all text messages that have appeared in the game — system messages, NPC speech, player chat, skill gain notifications, and more. Commonly used to detect events and gate script logic on what has been said.
ignoreList
ignoreList holds the set of entity serial numbers that search functions (such as client.findMobile() and client.findItem()) will skip over. Use it to exclude entities you have already processed so your script does not act on the same object twice.
target
target provides methods for requesting and responding to targeting cursors — both object targets and ground targets. It is used whenever an action (such as casting a spell) opens a target cursor that needs to be fulfilled programmatically.
worldMap
worldMap lets you read information from and interact with the in-game world map. You can add, remove, or query custom markers to help navigate or track locations during a script run.
popupMenu
popupMenu gives scripts access to context menus — the menus that appear when you right-click on a mobile or item. Use it to open a context menu on an entity and then click one of its entries programmatically.
Built-in Functions
These three functions are available in every script without any import. They handle timing, console output, and early termination.sleep()
sleep() is the standard way to pace actions and avoid sending commands faster than the server can process them.
The delay timing for long durations is not guaranteed to be exact. Network latency and browser scheduling can introduce small variances. Avoid relying on sub-millisecond precision.
The number of milliseconds to delay before the script continues. For example, pass
1000 to pause for one second.log()
One or more values to print. Multiple values are separated by a space in the console output, matching the behaviour of
console.log().exit()
exit() is called — no further statements run. An optional reason string is written to the console area so you can see why the script stopped.
An optional human-readable explanation for why the script is stopping. This message appears in the console output beneath the scripting window.
Practical Multi-Global Example
The following script demonstrates several globals working together. It checks the player’s health, scans for nearby hostiles, logs what it finds, and usesexit() to bail out if the situation is unsafe: