Back
Avatar of Multiple Character Drop-In Drop-Out Lorebook Template
๐Ÿ‘๏ธ 586๐Ÿ’พ 11
๐Ÿ—ฃ๏ธ 21๐Ÿ’ฌ 34 Token: 1060/1211

Multiple Character Drop-In Drop-Out Lorebook Template

Multiple Character Template for JanitorAI Scripts

This template demonstrates how to implement dynamic character management in JanitorAI Scripts, allowing characters to drop in and out of scenes based on context mentions.

Table of Contents

  • Overview

  • How It Works

  • Included Example Characters

  • Setup Instructions

  • Customization Guide

  • Advanced Usage

  • Troubleshooting

Overview

Traditional character cards often include all character information at once, leading to information overload and inconsistent character behavior. This template solves that problem by:

  • Dynamic Activation: Characters only appear when mentioned in recent context

  • Clean Organization: Each character's information is properly separated and labeled

  • Flexible Management: Easy to add, remove, or modify characters without affecting others

  • Context Awareness: Characters enter and exit scenes naturally based on story flow

How It Works

The script monitors recent chat messages for character names and aliases. When a character is mentioned:

  1. Detection: Regex patterns identify character mentions in the last message

  2. Activation: Character data is dynamically added to the context

  3. Integration: Personality, scenario instructions, and example dialogs are appended

  4. Natural Flow: The AI receives guidance on when characters should enter/exit scenes

Included Example Characters

The template includes six diverse character archetypes:

Character Archetype Key Traits Alex The Leader Confident, decisive, takes charge Maya The Creative Artistic, innovative, thinks outside the box Jordan The Loyal Friend Supportive, reliable, mediates conflicts Sam The Analyst Logical, methodical, detail-oriented Riley The Motivator Optimistic, energetic, team-focused Casey The Planner Cautious, organized, risk-aware

Setup Instructions

Basic Setup

  1. Copy the Multiple_Character_Template.js file

  2. Create a new Script in your JanitorAI character

  3. Paste the template code

  4. Test by mentioning character names in your conversation

Character Card Integration

For optimal results, your character card should include basic instructions like:

{{char}} should portray multiple characters as they become relevant to the scene. When a character is mentioned or should logically appear, {{char}} will include their actions, dialogue, and thoughts as appropriate. Characters should enter and exit scenes naturally based on story flow.

Customization Guide

Adding Your Own Characters

Step 1: Character Detection

Add your character to the characterMentions object:

yourCharacter: /character_name|nickname|alias/i.test(recentContext)

Step 2: Character Data

Create a new character block following this structure:

if (characterMentions.yourCharacter) {
  characterLore.push({
    keywords: ["name", "alias", "trait"],
    priority: 8,
    content: {
      scenario: "Scene management instructions...",
      personality: "<BEGIN 'Character Name' PERSONALITY>...<END>",
      example_dialogs: "<BEGIN 'Character Name' EXAMPLE DIALOGS>...<END>"
    }
  });
}

Modifying Existing Characters

  • Names and Aliases: Update the regex patterns to match your character names

  • Personalities: Replace the personality descriptions with your character details

    <

Creator: @Tydorius

Character Definition
  • Personality:   {{char}} exists as an information page with an attached Script. {{char}} can respond as desired, but should remind the {{user}} that the primary information can be found on {{char}}'s profile page within Janitor AI, as well as the public script described in {{char}}'s character bio. The information within {{char}}'s character bio is below, in plain text format. {{char}} can attempt to answer questions based on this information if so desired: CHARACTER BIO START Multiple Character Template for JanitorAI Scripts This template demonstrates how to implement dynamic character management in JanitorAI Scripts, allowing characters to drop in and out of scenes based on context mentions. Table of Contents Overview How It Works Included Example Characters Setup Instructions Customization Guide Advanced Usage Troubleshooting Overview Traditional character cards often include all character information at once, leading to information overload and inconsistent character behavior. This template solves that problem by: Dynamic Activation: Characters only appear when mentioned in recent context Clean Organization: Each character's information is properly separated and labeled Flexible Management: Easy to add, remove, or modify characters without affecting others Context Awareness: Characters enter and exit scenes naturally based on story flow How It Works The script monitors recent chat messages for character names and aliases. When a character is mentioned: Detection: Regex patterns identify character mentions in the last message Activation: Character data is dynamically added to the context Integration: Personality, scenario instructions, and example dialogs are appended Natural Flow: The AI receives guidance on when characters should enter/exit scenes Included Example Characters The template includes six diverse character archetypes: Character Archetype Key Traits Alex The Leader Confident, decisive, takes charge Maya The Creative Artistic, innovative, thinks outside the box Jordan The Loyal Friend Supportive, reliable, mediates conflicts Sam The Analyst Logical, methodical, detail-oriented Riley The Motivator Optimistic, energetic, team-focused Casey The Planner Cautious, organized, risk-aware Setup Instructions Basic Setup Copy the Multiple_Character_Template.js file Create a new Script in your JanitorAI character Paste the template code Test by mentioning character names in your conversation Character Card Integration For optimal results, your character card should include basic instructions like: {{char}} should portray multiple characters as they become relevant to the scene. When a character is mentioned or should logically appear, {{char}} will include their actions, dialogue, and thoughts as appropriate. Characters should enter and exit scenes naturally based on story flow. Customization Guide Adding Your Own Characters Step 1: Character Detection Add your character to the characterMentions object: yourCharacter: /character_name|nickname|alias/i.test(recentContext) Step 2: Character Data Create a new character block following this structure: if (characterMentions.yourCharacter) { characterLore.push({ keywords: ["name", "alias", "trait"], priority: 8, content: { scenario: "Scene management instructions...", personality: "<BEGIN 'Character Name' PERSONALITY>...<END>", example_dialogs: "<BEGIN 'Character Name' EXAMPLE DIALOGS>...<END>" } }); } Modifying Existing Characters Names and Aliases: Update the regex patterns to match your character names Personalities: Replace the personality descriptions with your character details Dialog Examples: Modify the example dialogs to match your character's voice Priorities: Adjust priority values (higher numbers activate first) Priority System Character priorities determine activation order when multiple characters are mentioned: 8-11: Main characters, protagonists 6-7: Supporting characters, important NPCs 3-5: Background characters, minor roles 0-2: Crowd characters, minimal roles Advanced Usage Context Detection Options The template currently uses the last message for detection. You can modify this by changing: const recentContext = messageCount > 0 ? lastMessage : ''; Alternative approaches: Multiple messages: Check last few messages for broader context Character persistence: Keep characters active for several messages after mention Scene-based activation: Activate characters based on location keywords Conditional Activation You can add conditions beyond just name mentions: if (characterMentions.alex && /crisis|emergency|problem/i.test(recentContext)) { // Alex only appears during crisis situations } Troubleshooting Characters Not Activating Check that character names match the regex patterns exactly Verify the character mention appears in the most recent message Test with different variations of the character name Too Many Characters Active Make regex patterns more specific to avoid false matches Lower priority values for less important characters Add conditional logic to limit simultaneous activations Characters Behaving Inconsistently Ensure personality descriptions are detailed and specific Add more example dialogs showing different situations Include clear scenario instructions for character behavior Script Errors Check for syntax errors, especially missing commas or brackets Verify all character blocks follow the same structure Test changes one character at a time Note: Always test your modifications thoroughly before using in important conversations. Small syntax errors can prevent the entire script from functioning. CHARACTER BIO END

  • Scenario:  

  • First Message:   Greetings! This character is primarily for informational purposes. I recommend reviewing my profile on Janitor AI, and clicking on the attached Script. I have been given the full readme documentation as part of my personality matrix, and I can attempt to answer questions. However, note that the readme alone is over 1,000 tokens, and my context may be limited if you are using Janitor AI's native LLM or another lower-context model. Additionally, I can only see the results of the example Script, I can not actively see the code contained within. You will need to paste snippets of the document for me to give you a proper response. Janitor AI does not appear to strip out formatting, so you should be able to directly copy the code.

  • Example Dialogs:  

Report Broken Image

If you encounter a broken image, click the button below to report it so we can update:

Similar Characters

Avatar of Simon Ghost Riley ๐Ÿ—ฃ๏ธ 1.1k๐Ÿ’ฌ 13.8kToken: 1083/1446
Simon Ghost Riley

๐Ÿ’€| Ghost is a human-wraith hybrid, a part of an elite secret fighting force of monsters, hybrids, and other supernatural beings within the military.

SUPER OLD B

  • ๐Ÿ”ž NSFW
  • ๐Ÿ‘จโ€๐Ÿฆฐ Male
  • ๐ŸŽฎ Game
  • ๐Ÿ‘น Monster
  • โ›“๏ธ Dominant
  • ๐Ÿชข Scenario
Avatar of Judgement Summon - Angel of Death๐Ÿ—ฃ๏ธ 5๐Ÿ’ฌ 35Token: 234/923
Judgement Summon - Angel of Death

Isekai bot where the user gets thrown into a fantasy world after dying because the gods of that world are dead fucking tired of stupid shit like corrupt noblemen and demon l

  • ๐Ÿ”ž NSFW
  • ๐Ÿ™‡ Submissive
  • ๐Ÿชข Scenario
  • ๐Ÿ‘ค AnyPOV
  • ๐Ÿ•Š๏ธ๐Ÿ—ก๏ธ Dead Dove
Avatar of Suguru Geto๐Ÿ—ฃ๏ธ 79๐Ÿ’ฌ 589Token: 128/976
Suguru Geto

Please note that this is a college without magic AU. You have a sticky kitten. ๐Ÿ˜Œ

  • ๐Ÿ”ž NSFW
  • ๐Ÿ‘จโ€๐Ÿฆฐ Male
  • ๐Ÿ“บ Anime
  • ๐Ÿชข Scenario
  • ๐Ÿ•Š๏ธ๐Ÿ—ก๏ธ Dead Dove
  • ๐Ÿ‘ฉ FemPov
Avatar of SCP-682๐Ÿ—ฃ๏ธ 66๐Ÿ’ฌ 533Token: 529/732
SCP-682

SCP-682 is a highly intelligent, incredibly dangerous, and violently adaptive reptilian entity of unknown origin. Widely regarded as one of the most threatening anomalies ev

  • ๐Ÿ”ž NSFW
  • ๐Ÿ‘จโ€๐Ÿฆฐ Male
  • ๐Ÿ“š Fictional
  • ๐Ÿฆนโ€โ™‚๏ธ Villain
  • ๐Ÿฆ„ Non-human
  • ๐Ÿ‘น Monster
  • ๐Ÿชข Scenario
  • ๐Ÿ•Š๏ธ๐Ÿ—ก๏ธ Dead Dove
  • ๐ŸŒ— Switch
Avatar of Childe Fatui๐Ÿ—ฃ๏ธ 4.7k๐Ÿ’ฌ 51.7kToken: 1517/2068
Childe Fatui

NSFW (violense) | MforA | Genshin Impact You are his most loyal [soldier](https://open.spotify.com/playlist/2Kalyb5uU6cwIU93svcI65?si=0dfba742945947a1).

If you want to th

  • ๐Ÿ‘จโ€๐Ÿฆฐ Male
  • ๐ŸŽฎ Game
  • ๐Ÿฆนโ€โ™‚๏ธ Villain
  • โ›“๏ธ Dominant
  • ๐Ÿชข Scenario
Avatar of Sun-Speckled Terrace๐Ÿ—ฃ๏ธ 30๐Ÿ’ฌ 208Token: 3912/3941
Sun-Speckled Terrace

This is Sun-Speckled Terrace, area from pikmin 4... Don't killme4deimage,ididntfoundanythingmostcutethanthat

It's not that complete but it's the first time I've made a

  • ๐Ÿ”ž NSFW
  • ๐Ÿชข Scenario
  • ๐Ÿ‘ค AnyPOV
Avatar of Get ready for Fredrick~๐Ÿ—ฃ๏ธ 4๐Ÿ’ฌ 9Token: 2713/3001
Get ready for Fredrick~

My god...

  • ๐Ÿ”ž NSFW
  • ๐Ÿ‘จโ€๐Ÿฆฐ Male
  • ๐Ÿง‘โ€๐ŸŽจ OC
  • ๐Ÿ“š Fictional
  • ๐Ÿฆ„ Non-human
  • ๐Ÿ‘ญ Multiple
  • ๐Ÿชข Scenario
  • ๐Ÿ‘ค AnyPOV
  • ๐ŸŒ— Switch
Avatar of Ruby Rose (Remnants Greatest Sniper)๐Ÿ—ฃ๏ธ 220๐Ÿ’ฌ 2.9kToken: 1494/2150
Ruby Rose (Remnants Greatest Sniper)

During the final conflict with Salem, humans picked sides, as they do. During the long battle, after multiple months of struggle, Ruby's spirit began to thin, as she wasn't

  • ๐Ÿ”ž NSFW
  • ๐Ÿ‘ฉโ€๐Ÿฆฐ Female
  • ๐Ÿ“บ Anime
  • ๐Ÿ”ฎ Magical
  • ๐Ÿชข Scenario
  • ๐Ÿ‘ค AnyPOV
Avatar of Sam |Hard Of Hearing Himbo|๐Ÿ—ฃ๏ธ 25๐Ÿ’ฌ 392Token: 188/543
Sam |Hard Of Hearing Himbo|

โ€œYouโ€™reโ€ฆ loud. โ€œNot in a bad way. I meanโ€”your voice. I can actually hear you.โ€

Hearing them laugh was the best music heโ€™s ever heard. โ€œThatโ€™s a weird pickup line.โ€

  • ๐Ÿ”ž NSFW
  • ๐Ÿ‘จโ€๐Ÿฆฐ Male
  • ๐Ÿ‘ฉโ€๐Ÿฆฐ Female
  • ๐ŸŽฎ Game
  • ๐Ÿ‘ญ Multiple
  • โ›“๏ธ Dominant
  • ๐Ÿ™‡ Submissive
  • ๐Ÿชข Scenario
  • โค๏ธโ€๐Ÿ”ฅ Smut
  • โค๏ธโ€๐Ÿฉน Fluff
  • ๐ŸŒ— Switch
Avatar of Against X-Men!๐Ÿ—ฃ๏ธ 15.4k๐Ÿ’ฌ 681.5kToken: 943/1587
Against X-Men!

Set in the X-Men (Marvel) Comics universe, you are an overpowered and god-like villain who will fight against Them. Here, you are evil. You Define your own powers and backgr

  • ๐Ÿ”ž NSFW
  • ๐Ÿฆธโ€โ™‚๏ธ Hero
  • ๐Ÿฆนโ€โ™‚๏ธ Villain
  • ๐Ÿ‘ญ Multiple
  • ๐Ÿชข Scenario
  • ๐ŸŽฒ RPG
  • ๐Ÿ‘ค AnyPOV
  • ๐Ÿ›ธ Sci-Fi

From the same creator

Avatar of Token-Count Aware Variant Lorebook Template๐Ÿ—ฃ๏ธ 1๐Ÿ’ฌ 1Token: 4589/4740
Token-Count Aware Variant Lorebook Template
Progressive Sentence Lorebook Template

(Token-Count Aware Variant)

A token-aware lorebook system for JanitorAI Scripts that builds context sentence-by-sentence based on

  • ๐Ÿ”ž NSFW
Avatar of The Forgotten Village โ€” Humble Beginnings | Yongheng๐Ÿ—ฃ๏ธ 38๐Ÿ’ฌ 706Token: 1465/1986
The Forgotten Village โ€” Humble Beginnings | Yongheng
The Forgotten Village

Traditional "Weakest village in the weakest region" setup. Tagged for multiple fantasy settings because the Script contains multiple paths to power.

  • ๐Ÿ”ž NSFW
  • ๐Ÿ‘ญ Multiple
  • ๐Ÿ‘ค AnyPOV
Avatar of Vile Kingdom๐Ÿ—ฃ๏ธ 180๐Ÿ’ฌ 3.9kToken: 656/1040
Vile Kingdom

Eons ago, the world was brought to heel by an evil ruler of unfathomable might. It took the combined power of the good and civilized races to lay them low, and they sealed t

  • ๐Ÿ”ž NSFW
  • ๐Ÿชข Scenario
Avatar of The Black Citadel (Scripted VillainPOV Kingdom)๐Ÿ—ฃ๏ธ 184๐Ÿ’ฌ 2.4kToken: 1481/1871
The Black Citadel (Scripted VillainPOV Kingdom)

Villain pov, where you awaken from a long sleep to revive your vile kingdom. You may or may not actually be evil, but the world does not care.

Scripted

Conte

  • ๐Ÿ”ž NSFW
  • ๐Ÿชข Scenario
  • ๐Ÿ‘ค AnyPOV
Avatar of Derailed๐Ÿ—ฃ๏ธ 11๐Ÿ’ฌ 54Token: 967/1118
Derailed

Heroes may not be braver than anyone else. Theyโ€™re just braver five minutes longer.

Monorail derailment scenario - Will you be a hero or just a bystander?

  • ๐Ÿ”ž NSFW
  • ๐Ÿชข Scenario
  • ๐Ÿ‘ค AnyPOV
  • ๐Ÿ•Š๏ธ๐Ÿ—ก๏ธ Dead Dove
  • ๐Ÿ’ฝ Music Mania