Skip to content

API messagebox en

Codex edited this page Sep 26, 2026 · 1 revision

messagebox

ClassicUO / Basic IDE

Home · API · Journal

A built-in Basic function without UO. Takes exactly one string. Here messagebox does not open a dialog, wait for a button or return a user response; both functions use local game output.

Exact syntax

messagebox(text:String) -> Unit

Parameters

  • text — Message text. Join numbers explicitly with CStr; names and coordinates are not substituted automatically. Quotes delimit the string and are not sent as part of it.

Returns

Unit: no return value. Call on its own line; do not test its result as True/False, a serial or a count. Returning from the call does not confirm a server response.

Behavior

  • The line appears at the lower left of the game view and in the local journal. A copy is available in IDE output; the manager exposes local entries in the session system journal even without a game window. No speech packet is sent. This is not overhead text; use UO.CharPrint for that.
  • Printing itself appends to the journal. Save a search result or the last line before printing diagnostics. Avoid printing on every fast-loop iteration; report changes instead.
  • Without a color the hue is 0x03B2. UO.Print(text, color) takes text first; UO.ColorPrint(color, text) takes color first.
  • A built-in Basic function without UO. Takes exactly one string. Here messagebox does not open a dialog, wait for a button or return a user response; both functions use local game output.
  • UO.Print · UO.CharPrint · UO.Say · UO.ConColor

Internal functions: from call to result

The line appears at the lower left of the game view and in the local journal. A copy is available in IDE output; the manager exposes local entries in the session system journal even without a game window. No speech packet is sent. This is not overhead text; use UO.CharPrint for that.

1. Message

A built-in Basic function without UO. Takes exactly one string. Here messagebox does not open a dialog, wait for a button or return a user response; both functions use local game output.

Unit: no return value. Call on its own line; do not test its result as True/False, a serial or a count. Returning from the call does not confirm a server response.

Project source: external/InjectionScript/src/InjectionScript/Runtime/InjectionApi.cs; function Message.

2. PrintClientMessage

Shows a local progress message or stop condition. You see it; other players do not.

The line appears at the lower left of the game view and in the local journal. A copy is available in IDE output; the manager exposes local entries in the session system journal even without a game window. No speech packet is sent. This is not overhead text; use UO.CharPrint for that.

Project source: src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs; function PrintClientMessage.

3. Print

Printing itself appends to the journal. Save a search result or the last line before printing diagnostics. Avoid printing on every fast-loop iteration; report changes instead.

Unit: no return value. Call on its own line; do not test its result as True/False, a serial or a count. Returning from the call does not confirm a server response.

Project source: src/ClassicUO.Client/Game/GameActions.cs; function Print.

Examples

Progress summary

# Progress summary
#
# A built-in Basic function without UO. Takes exactly one string. Here messagebox does not open
# a dialog, wait for a button or return a user response; both functions use local game output.
#
# Unit: no return value. Call on its own line; do not test its result as True/False, a serial or
# a count. Returning from the call does not confirm a server response.

SUB Main()
    # processed=12 is a demonstration count of already processed items. CStr converts it to text.
    # The example only reports this count; it does not move items.

    VAR processed = 12
    messagebox("Processed item entries: " + CStr(processed))
END SUB

Parameter and execution notes:

  • processed=12 is a demonstration count of already processed items. CStr converts it to text. The example only reports this count; it does not move items.

Overweight warning

# Overweight warning
#
# A built-in Basic function without UO. Takes exactly one string. Here messagebox does not open
# a dialog, wait for a button or return a user response; both functions use local game output.
#
# Unit: no return value. Call on its own line; do not test its result as True/False, a serial or
# a count. Returning from the call does not confirm a server response.

SUB Main()
    # Reads character weight and maximum weight. A zero or unknown maximum does not count as
    # overweight. When weight >= maximum, one line is printed and Main returns; nothing is dropped.

    VAR weight = UO.Weight()
    VAR maximum = UO.MaxWeight()
    IF maximum > 0 AND weight >= maximum THEN
        messagebox("Too heavy: " + CStr(weight) + "/" + CStr(maximum))
        RETURN
    END IF
END SUB

Parameter and execution notes:

  • Reads character weight and maximum weight. A zero or unknown maximum does not count as overweight. When weight >= maximum, one line is printed and Main returns; nothing is dropped.

Report only a weight change

# Report only a weight change
#
# A built-in Basic function without UO. Takes exactly one string. Here messagebox does not open
# a dialog, wait for a button or return a user response; both functions use local game output.
#
# Unit: no return value. Call on its own line; do not test its result as True/False, a serial or
# a count. Returning from the call does not confirm a server response.

SUB Main()
    # Main saves the weight, waits 1000 milliseconds and calls the fully declared ReportWeight
    # helper. The helper prints only when weight changed, then returns the new weight for the next
    # check. It does not create an endless loop.

    VAR previous = UO.Weight()
    UO.Wait(1000)
    previous = ReportWeight(previous, UO.Weight())
END SUB

SUB ReportWeight(previous, current)
    IF previous <> current THEN
        messagebox("Weight changed: " + CStr(current))
    END IF
    RETURN current
END SUB

Parameter and execution notes:

  • Main saves the weight, waits 1000 milliseconds and calls the fully declared ReportWeight helper. The helper prints only when weight changed, then returns the new weight for the next check. It does not create an endless loop.

Русский · English · Українська · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

Clone this wiki locally