Articles on: Scripts

What Are Scripts - A Beginner Friendly Overview

What Are Scripts? (Overview)


Scripts is like giving your character a smart assistant that whispers helpful information in their ear during conversations. Instead of your character always being exactly the same, Scripts help them react naturally to what's happening in your chat.


Important: Think of Scripts like sticky notes that appear just for the current message. They don't permanently change your character unless you specifically build that with Advanced scripts.


What Are Scripts?


Imagine your character has an invisible friend sitting next to them during your conversation. This friend:

  • Knows tons of background information about your world
  • Pays attention to what you're talking about
  • Occasionally whispers relevant details to your character
  • Sometimes stays quiet to keep things natural


That's exactly what Scripts do! They automatically sprinkle in relevant information when certain topics come up.


Important: Only YOU Trigger Scripts

Here's something super important that might confuse you at first: Scripts only wake up when YOU (the user) say the keywords, not when your character says them.


Example:


  • Your character has a lorebook entry for "Clare" (their best friend)
  • You say: Tell me about Clare" → The Clare entry activates ✅
  • Your character responds: "Clare is my best friend from college" → Nothing activates ❌

Think of it like: Your invisible assistant only listens to you, not to what your character says back. This prevents Scripts from triggering other scripts in an endless loop.


Two Types of Scripts


Lorebook Scripts — Like a Smart Encyclopedia

Think of this as a magical book that automatically opens to the right page when you mention something. You write "entries" (like encyclopedia articles) with:

  • Trigger words that wake up the entry
  • One text box with what gets whispered to your character


Example: When you say "cooking dinner," the book automatically opens to: "The kitchen fills with warm, savory aromas that make your stomach rumble with anticipation."


Important: Each Lorebook entry has just one text box. If you want to whisper different things to your character's personality vs the scene description, you'll need to upgrade that specific entry to Advanced mode.


Advanced Scripts — Like a Personal Assistant

This is for when you want your invisible assistant to follow more complex rules, like "if they've been chatting for a while, be more friendly" or "send this note about personality, but that note about the scene."


Bonus: If you already use SillyTavern, you can copy-paste your existing lorebook entries right into the Source Code view of a Lorebook script. Just make sure you copy the contents of the entries array (the stuff inside the square brackets), not the entries key itself:


Copy this part:

[
{ "entry data here" },
{ "more entry data" }
]


Not this:

{
"entries": [
{ "entry data here" },
{ "more entry data" }
]
}


The Building Blocks (Don't Worry, They're Simple!)


Keywords: The Wake-Up Words

These are like alarm clocks for your entries. When these words appear in your conversation, they wake up the entry and add its content.


Think of it like: A dog that perks up when it hears "walk" — your entries perk up when they hear their special words.


Probability: The Coin Flip

Probability rerolls every message. If the keys match this turn, we roll again next turn — no "sticky" state.

  • 50% probability = flip a coin each time. Heads = the entry speaks up, tails = it stays quiet
  • 100% probability = always speaks up (like an overeager friend who never misses a chance to share)


Tip: For entries that compete inside a group, set Probability to 100% and let Group Weight (or Prioritize Inclusion) decide the winner. This avoids double randomness.


Min Messages: The Patience Counter

This is like telling your assistant "wait until we've been chatting for a while before mentioning this." Great for saving important plot points until later in the conversation.


When Multiple Things Want to Speak: Traffic Control


Order: Who Goes First

Imagine several friends all want to tell you something at once. The order of your entries determines the priority of who gets to speak first by giving them numbers — person #1 (at the top of the list) talks before person #5 (in the middle).

  • Use high priority (like 1) for important rules or safety information
  • Use medium priority (like 5) for scene-setting and character details
  • Use low priority (like 10) for fun flavor text and easter eggs


Glue it together: First, each Inclusion Group picks one winner (by Group Weight or by Prioritize Inclusion). Then Priority decides which of the winners matter most if there's still too much to say.


Inclusion Groups: The "Only One Friend Talks" Rule

This solves the problem of having 10 different friends all trying to tell you about cooking at the same time. Inclusion Groups are like saying "okay, all you cooking experts, pick ONE person to speak for the group."


How it works:

  • Put similar entries in the same "group" (like naming them all cooking_tips)
  • When cooking comes up, only ONE of them gets to talk
  • The others politely stay quiet


Want zero randomness? Under Group Selection Mode, toggle Use insertion order for that group to always pick the entry with the highest Order value.


Advanced note: One entry can belong to multiple groups (comma-separated). If it wins, it suppresses other entries in any of those groups for that turn.


Group Weight: The Lottery Ticket System

When the group needs to pick who talks, Group Weight is like giving each friend a different number of lottery tickets:

  • Friend A gets 70 tickets (talks most of the time)
  • Friend B gets 30 tickets (talks sometimes)
  • Friend C gets 100 tickets (talks a lot)


The system randomly draws a ticket to see who wins the right to speak.


Key Match Priority: The "Most Specific Friend Wins" Rule

This is like having a rule that says "whoever knows the most about this exact topic gets to talk."


Example:

  • Friend A knows about "music" in general
  • Friend B knows about "piano music" specifically
  • When you say "piano concert," Friend B automatically wins because they're more specific


One-liner: Toggling the option Prioritize by number of matched keys narrows the group to the best matches first; then the final pick is made by Group Weight (random) or by Order if Use insertion order is on.


Multiple Scripts: Like Having Different Expert Friends


You can give your character several different "expert friends":

  • One who knows about hobbies and interests
  • One who tracks your relationship
  • One who handles personality changes
  • They all work together, taking turns based on the traffic control rules above


The Big Picture


Scripts turn your character from a static person into someone who feels like they're really living in their world. They remember details, react to situations, and surprise you with variety — all while feeling completely natural.


Think of it as the difference between talking to someone reading from a script versus talking to someone who actually lives in that world and has real knowledge and feelings about it.

Updated on: 06/09/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!