Skip to content

Legion Scripting — ZIP File Support

You can now distribute complete script libraries as a single .zip file. Drop it in your LegionScripts/ folder and TazUO will load scripts and textures directly from the archive — no extraction needed.


MyLibrary.zip
├── GroupName/
│ ├── SubGroup/
│ │ └── myscript.py
│ └── another.py
└── images/
└── mybutton.png ← named texture (any folder)
  • Scripts must be .py or .cs
  • Max 2 levels of grouping (Group/SubGroup/script.py) — deeper entries are skipped
  • Files or folders starting with _ or . are ignored (e.g. __pycache__, .DS_Store)
  • API.py is always skipped

Any PNG in the zip is registered as a named texture, accessible by:

  • Full entry path: images/mybutton.png
  • Filename only: mybutton.png (first match wins if names collide)
# LegionTextureControl(name, width=0, height=0)
# width/height default to the image's natural size
img = API.Gumps.LegionTextureControl("mybutton.png")
gump.AddControl(img)
# Resize if needed
img2 = API.Gumps.LegionTextureControl("images/mybutton.png", 64, 64)
gump.AddControl(img2)
img.TextureName = "other_image.png"

Right-clicking a zip-sourced script in the Script Manager shows a 3-option dialog:

OptionEffect
Delete Script OnlyRemoves just that .py/.cs entry from inside the zip
Delete Entire ZipDeletes the whole .zip file and unloads all its scripts
CancelDoes nothing

Rename, Edit Externally, and Open Location are hidden for zip scripts — they don’t apply to entries inside an archive.


  • Scripts inside zips cannot import other scripts via relative paths; use the zip’s own module structure via sys.path (the zip itself is added automatically)
  • Editing a zip script via the in-game Constants Editor writes back into the zip correctly
  • Textures are loaded at script-load time; reloading scripts reloads textures