Legion-Scripting
Legion Scripting
Section titled “Legion Scripting”TazUO has implemented a scripting engine directly into the client.
You can access Legion Scripting by going to Top menu -> Legion Script
Introduction
Section titled “Introduction”Public Script Library set up here for people to contribute to.
ZIP Script Packages — bundle a script and its assets into a single .zip.
Running scripts from a hotkey
Section titled “Running scripts from a hotkey”You can bind a Legion script directly to a hotkey. Right-click the script and choose Set Hotkey, then press the key combination you want. The binding is saved per script path and persists globally (across characters), and pressing the key toggles that script on and off. See Hotkeys.
You can also drive a script from a Spell Bar Script slot, which toggles the script and highlights green while it runs.
The Script Manager window remembers its size and position and restores them when reopened.
Recent API additions
Section titled “Recent API additions”API.Virtue("justice")— the virtue API now supports justice in addition to honor, sacrifice, and valor.API.OpenQuestLog()— opens the quest log gump.API.OpenHelp()— opens the help menu.API.Pathfind(x, y, z, distance, wait, timeout, run)andAPI.PathfindEntity(entity, distance, wait, timeout, run)— a new run parameter controls whether the character runs (default true) or walks along the path..IsParalyzed— a boolean property on mobile objects.API.UpdateCooldown(name, maxValue, currentValue),API.RestartCooldown(name),API.DeleteCooldown(name)andAPI.CooldownExists(name)— manage cooldown bars created withAPI.CreateCooldownBar.API.Gumps.CreateGumpTextBox(text, width, height, multiline, fontSize)— a new fontSize parameter (default 20) sizes the TTF font of the text input field, andApiUiTtfTextInputField.FontSizeexposes it as a property.API.ActiveSpells(),API.ActiveSpellNames()andAPI.IsSpellActive(spell)— see which toggle spells/moves are currently active (the same ones the spell bar highlights).API.ListRunningScripts()andAPI.IsScriptRunning(path).API.PlayScript,API.StopScriptandAPI.ToggleScriptnow match scripts by their path relative to theLegionScriptsfolder, so scripts that share a file name are no longer ambiguous.API.ContextMenu(serial, entry)— a string-based overload that selects a context menu entry by its text.SetTooltip(text),SetEntityTooltip(serial)andClearTooltip()on the base UI control, so scripts can attach plain-text or entity-property tooltips to any control. Setting a tooltip enables mouse input automatically, and a dedicatedSetAcceptMouseInput(enabled)is also available.Highlight(hue)on game objects and mobiles — sets a highlight hue (remembering the original so it can be restored withHighlight(None)); on mobiles it also recolors all equipped items.
Screenshots
Section titled “Screenshots”Bonus, Github Copilot can create scripts for you
Section titled “Bonus, Github Copilot can create scripts for you”-
Head over to the documentation you want to use(Links above)
-
Login to Github
-
Click this little copilot icon on the file:
-
Ask it to create a script:
Script Recording:
Section titled “Script Recording:”To start recording a script just hit Record Button, once you’re recording you will see each action under Recorded actions
You can pause and resume recording under your needs, move up/down or delete actions.
To finish script recording click Stop button.
You can choose to copy script or save it directly. Saved scripts will be displayed at Script manager: