![]() |
![]() |
|
|
|
Table of Contents
Variables in Easy UO come in four types; Standard, Namespace, Persistent and System. The type of a variable is defined by its first character. Repectively Standard variables start with a percent sign, Namespace variables with an exclamation mark, Persistant variables with an asteriks sign and System variables with an hash sign.
Variable names follow the same rules as other labels in EasyUO. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
set %var Bob set %Var Joe msg %var %Var ; outputs "JOE JOE" set %4bank not_yet ; invalid; starts with a number set %_4bank not_yet ; valid; starts with an underscore
Standard variables in EasyUO are represented by a percent sign (%) followed by the name of the variable. The variable name is case insensitive.
Namespace variables in EasyUO are represented by an exclamation mark (!) followed by the name of the variable. Namespace variable name is case insensitive.
Namespace variables visibility is affected by the nameSpace command.
Namespace variables within a local namespace can only be accessed by the current script.
Namespace variables within a global namespace can be accessed by all scripts running in the same instance of EasyUO (not yet available).
Persistent variables in EasyUO are represented by a asteriks sign (*) followed by a number between 1 and 1000 (both inclusive).
Persistent variables are shared between all instances of EasyUO running on the computer. Persistent variables are stored in the registry under the key HKEY_CURRENT_USER\Software\EasyUO.
System variables in EasyUO are represented by an hash sign (#) followed by a descriptive text. System variable name is case insensitive.
System variables are all described in detail in the System Variable Reference.
The different variable types have different scope depending on different things. Here is an explaination of how it works:
Table 2.1. EasyUO Variables
| Type | Scope |
|---|---|
| Standard | Scope is limited to the current script running. Standard Variables are cleared when EasyUO exits. |
| Namespace | Scope is defined by using the nameSpace command. A Local namespace is accessible to the current script running only. A Global namespace is accessible to all scripts running in the same EasyUO instance (not yet available). Namespace Variables are cleared when EasyUO exits. |
| Persistent | Scope is limited to all scripts running on the same computer. Persistent Variables are stored in the registry and not cleared when EasyUO exits. |
| System | Scope is typically defined by the current Ultima Online instance for the current script running. System Variables are not saved by EasyUO upon exit. |