-
Notifications
You must be signed in to change notification settings - Fork 0
API UO Exec en
Русский · English · Українська · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
UO.Exec · UO.Launch · UO.CallSub · UO.FunRunning · UO.SubExists
ClassicUO • Runtime API
Executes one command written in console form. Use it when an action name or its arguments are assembled as text. Ordinary scripts are clearer with direct UO.UseSkill("Hiding") calls; Exec does not evaluate arbitrary Basic source.
UO.Exec(parameters:String) -> Unit
-
parameters— Required String: command name followed by space-separated arguments, for example useskill Hiding. Inside the string omit UO., call parentheses and argument commas. The Basic call itself is UO.Exec(...). Empty input does nothing.
Unit: no value. Exec discards even the return value of an underlying native command or local Function. Use a direct call to obtain that result. Returning from Exec does not confirm a server action.
- Single or double quotes group arguments containing spaces; '' preserves an empty argument. Quoted tokens stay String, so '00123' does not become 123. Unquoted numbers are parsed numerically; other tokens remain strings. Expressions such as 2+3 are not evaluated.
- Windows and UNC backslashes are preserved. Double a trailing backslash immediately before a closing quote, or use /. Inside a quoted argument, double the matching quote or escape it with a backslash. An unmatched quote raises a catchable error. Print/Msg/Say/ConsolePrint/TextPrint join remaining tokens as text; ColorPrint and CharPrint keep their initial arguments separate.
- Ordinary dispatch prefers a matching UO handler, then a local Sub/Function in this runtime with the matching argument count. Local calls are synchronous. The special exec ProcedureName form passes zero arguments to the manager and requests a separate task; an unknown name in this special form starts nothing. A procedure name is not a file path.
- An unknown ordinary command, wrong argument count or malformed quotes raises an error that Try/Catch can handle. exec requires exactly one nonblank name. Repeating an active task neither duplicates nor resumes it. Use startscript for a file; SubExists and FunRunning inspect the loaded catalogue. Console aliases: sayu → Say, closeuo → CloseHandle, CountOnGround → CountGround, clearignorelist → IgnoreReset, canceltarget → CancelTarget, cancelmove → MoveOff.
These are client implementation stages, not additional Basic commands. Example helper procedures are defined in full.
Single or double quotes group arguments containing spaces; '' preserves an empty argument. Quoted tokens stay String, so '00123' does not become 123. Unquoted numbers are parsed numerically; other tokens remain strings. Expressions such as 2+3 are not evaluated.
Windows and UNC backslashes are preserved. Double a trailing backslash immediately before a closing quote, or use /. Inside a quoted argument, double the matching quote or escape it with a backslash. An unmatched quote raises a catchable error. Print/Msg/Say/ConsolePrint/TextPrint join remaining tokens as text; ColorPrint and CharPrint keep their initial arguments separate.
Project source: external/InjectionScript/src/InjectionScript/Runtime/InjectionRuntime.cs; function Tokenize.
Ordinary dispatch prefers a matching UO handler, then a local Sub/Function in this runtime with the matching argument count. Local calls are synchronous. The special exec ProcedureName form passes zero arguments to the manager and requests a separate task; an unknown name in this special form starts nothing. A procedure name is not a file path.
Unit: no value. Exec discards even the return value of an underlying native command or local Function. Use a direct call to obtain that result. Returning from Exec does not confirm a server action.
Project source: external/InjectionScript/src/InjectionScript/Runtime/InjectionRuntime.cs; function Exec / CallNativeSubrutine.
These are client implementation stages, not additional Basic commands. Example helper procedures are defined in full.
# Use a chosen skill
#
# Executes one command written in console form. Use it when an action name or its arguments are
# assembled as text. Ordinary scripts are clearer with direct UO.UseSkill("Hiding") calls; Exec
# does not evaluate arbitrary Basic source.
#
# Unit: no value. Exec discards even the return value of an underlying native command or local
# Function. Use a direct call to obtain that result. Returning from Exec does not confirm a
# server action.
SUB Main()
# Hiding is the single UseSkill argument. While in the world the client requests the skill; the
# server decides whether hiding succeeds. The direct equivalent is UO.UseSkill("Hiding").
UO.Exec("useskill Hiding")
END SUBParameter and execution notes:
- Hiding is the single UseSkill argument. While in the world the client requests the skill; the server decides whether hiding succeeds. The direct equivalent is UO.UseSkill("Hiding").
# Pass a text label to a local procedure
#
# Executes one command written in console form. Use it when an action name or its arguments are
# assembled as text. Ordinary scripts are clearer with direct UO.UseSkill("Hiding") calls; Exec
# does not evaluate arbitrary Basic source.
#
# Unit: no value. Exec discards even the return value of an underlying native command or local
# Function. Use a direct call to obtain that result. Returning from Exec does not confirm a
# server action.
SUB Main()
# SelectSavedRoute is defined below and stores the selected route name. Quotes retain the
# leading zeros in 00123. Exec waits for this local procedure, then Main returns the string
# 00123. This stores a demonstration label; it does not move the character.
UO.Exec("SelectSavedRoute '00123'")
Return UO.GetGlobal("manual", "savedRoute")
END SUB
Sub SelectSavedRoute(name)
UO.SetGlobal("manual", "savedRoute", name)
End SubParameter and execution notes:
- SelectSavedRoute is defined below and stores the selected route name. Quotes retain the leading zeros in 00123. Exec waits for this local procedure, then Main returns the string 00123. This stores a demonstration label; it does not move the character.
# Start an independent monitor
#
# Executes one command written in console form. Use it when an action name or its arguments are
# assembled as text. Ordinary scripts are clearer with direct UO.UseSkill("Hiding") calls; Exec
# does not evaluate arbitrary Basic source.
#
# Unit: no value. Exec discards even the return value of an underlying native command or local
# Function. Use a direct call to obtain that result. Returning from Exec does not confirm a
# server action.
SUB Main()
# Load the whole file into the IDE/manager and run Main so WeightWatch is in the catalogue. exec
# WeightWatch requests three weight samples 1000 ms apart without waiting for completion.
# Concurrent procedures must be allowed. Calling it again does not resume a paused task.
UO.Exec("exec WeightWatch")
END SUB
Sub WeightWatch()
Dim sample
For sample = 1 To 3
If UO.Connected() Then
UO.Print("Weight: " & CStr(UO.Weight()))
End If
UO.Wait(1000)
Next
End SubParameter and execution notes:
- Load the whole file into the IDE/manager and run Main so WeightWatch is in the catalogue. exec WeightWatch requests three weight samples 1000 ms apart without waiting for completion. Concurrent procedures must be allowed. Calling it again does not resume a paused task.
# Load a script from a path containing spaces
#
# Executes one command written in console form. Use it when an action name or its arguments are
# assembled as text. Ordinary scripts are clearer with direct UO.UseSkill("Hiding") calls; Exec
# does not evaluate arbitrary Basic source.
#
# Unit: no value. Exec discards even the return value of an underlying native command or local
# Function. Use a direct call to obtain that result. Returning from Exec does not confirm a
# server action.
SUB Main()
# Replace the path with an existing Basic file that defines your Main procedure. startscript
# loads the file and requests Main. The inner quotes belong to the console command and path
# backslashes are retained. Check IDE errors because Exec returns no launch acknowledgement.
UO.Exec("startscript 'C:\UO Scripts\Gather.bas'")
END SUBParameter and execution notes:
- Replace the path with an existing Basic file that defines your Main procedure. startscript loads the file and requests Main. The inner quotes belong to the console command and path backslashes are retained. Check IDE errors because Exec returns no launch acknowledgement.
ClassicUO
Bad Newbie & Basic IDE
Найти в справочнике
Клиент и скрипты
Каталоги значений
Разработка и помощь