EN AutoLoad and Macros - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki

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

AutoLoad and manager

Work scripts have the extension .csx.

Full_Client/
  Autoload/
    Autoload.csx
    Scripts/
      Hello.csx
      Position.csx

In the standalone Full client, the selected AutoLoad is saved in the character profile. In the manager, the list of Scripts is stored in a specific profile. Adding a file to the editor does not in itself write it into the next run set.

The script is executed in the session to which the profile belongs. Closing the game view or IDE should not mix up the state of different characters.

Example AutoLoad

UO.Print("AutoLoad started");
await WaitAsync(100);

The script ends after the last statement. To save background execution, write a loop with a wait and termination conditions. Stopping a profile and Stop cancel its execution.

Saving and reloading

Saving does not restart an active script. The next file start from Manager and selected AutoLoad commands read the saved code from disk. Run in the editor uses the current document text.

Reload stops previous executions of the selected AutoLoad only and waits for their cleanup while the game view and Manager remain responsive. Another click during reloading reports that the operation is still busy. Other files and profiles keep running.

If the previous code has not finished after 15 seconds, an error replaces indefinite Loading. Pass Cancellation to asynchronous waits, let cleanup finish, then retry Reload. A replacement never overlaps the old execution. Compilation errors include diagnostics; after correcting them, save and retry Reload.

await Task.Delay(100, Cancellation);