How do I use Scripting in AI Dungeon?

How do I use Scripting in AI Dungeon?

How to use Scripting in AI Dungeon

icon
Scripting allows you to modify the player experience beyond what is supported in the Scenario editor. Because of this, using a script can be dangerous if you don’t know what it does. Please be cautious and make backups of anything you don’t want to lose!

Adventure Scripts

Adventure Scripts let you add community-made Scripts to any Adventure—even one you're already playing. Dice rolls, automatic Story Cards, stat tracking and more: find a Script you like, add it and keep playing. No code required!

What are Scripts?

Scripts are add-ons that change how your Adventure plays. They can roll dice, track stats, create Story Cards for you, show quick notifications and a lot more.

In the past, a Script only lived inside the Scenario it was written for. To use one, you had to play that Scenario or copy its code into your own.

Adventure Scripts are shared on their own instead. You can find them in Discover, save the ones you like and add them to any Adventure you play.

Add a Script to your Adventure

You can add Scripts at any point, including to an Adventure you started weeks ago:

  1. Open Game settings. In your Adventure, open Game settings and go to the Scripts tab.
  2. Select “+ Add Script” at the bottom of the list.
  3. Pick a Script. “Saved” shows Scripts you've saved from Discover, and “My Scripts” shows Scripts you've made.
  4. Take a turn. The Script starts working with your next action.
image

Find Scripts in Discover

To browse Scripts, open Discover and choose Filters → Content Type → Scripts.

Script cards have a SCRIPT tag and a Save button instead of Play, since Scripts aren't played on their own. Saving a Script adds it to your “Saved” list, ready to add to any Adventure. You can also find Scripts you've saved on your profile, under Bookmarks → Scripts.

image

Browse Scripts in Discover →

Manage your Scripts

Everything happens in the same Scripts tab:

  • Turn a Script off or on with its toggle. Turned-off Scripts stay in the list, dimmed, so you can switch them back on later.
  • Change the order with the arrows. Scripts run from the top of the list down, which matters when two Scripts change the same thing.
  • Expand a Script to see its description, its version and the option to remove it.
  • Add up to 10 Scripts to one Adventure.

If your Adventure started from a Scenario with its own Script, that Script appears in the list too. You can turn it off if it clashes with another Script, but the Scenario may have been built around it, so some of its features might stop working.

‣

If a Script isn't working

Share your own Scripts

Wrote a Script, or adapted one for your own Scenarios? Turn it into an Adventure Script so you—and anyone else—can add it to any story.

  1. Write your Script in a Scenario using the Scripting editor. The technical reference further down this page covers everything the editor can do.
  2. Turn on “Mark as Script” in the Scenario editor. Your Script now appears under “My Scripts”, ready to add to your own Adventures. It stays private until you publish it.
  3. Publish it to share it. When you publish, turn on “Publish as a Script”. It then appears in Discover under Scripts and on your profile's Scripts tab. Like Scenarios, Scripts need a content rating check before publishing.

A good description helps players a lot. Say what your Script does, any commands players can type, and anything they should set up first.

Add Scripts to your Scenario

You can add Adventure Scripts to a Scenario from its Scripts tab, the same way you add them to an Adventure. Everyone who plays your Scenario gets those Scripts automatically, so you don't need to copy code from one Scenario to another.

‣
For script writers: making Scripts that play well with others:
‣

Common questions

đź’¬

Looking for more Scripts, or want help making your own? Check out the Script Library forum on our official Discord server!

‣

Scripting in Scenarios v.s. Adventures

‣

Scripting UI

‣

Scripting API

‣

Example Scripts

‣

Reporting Issues

icon
image

© Latitude 2026