LumiChat AI

Dynamic character logic, explained safely

Janitor AI Scripts Guide (2026): Setup, Safety & Fixes

Learn what Janitor AI scripts do, how they differ from prompts and lorebooks, how to add and test one safely, and how to fix common script errors.

Author: LumiChat AI TeamPublished:

13 min read

Quick answer

What this guide explains

Janitor AI Scripts are conditional JavaScript logic attached to character content, often through special lorebook entries. They can inspect the current chat state and append context before a reply, but they are not the same as Advanced Prompts, normal lore entries or permanent chat memory. Use one script at a time, review its source, test it in a disposable chat, inspect the debug output and keep a clean copy of the original character before publishing changes.

  • Quick answer: what a Janitor AI Script actually does
  • Script, Advanced Prompt, Lorebook and Chat Memory are different
  • Decide whether the Script is worth adding

Featured companions

Three characters refresh on each visit. Cards play a promo video when available and otherwise show the character image.

Cassian Vale

Nocturnal hunter

Cassian Vale

Playful hunter-and-rival energy for users who prefer suspense, reversals, and a partner who pushes back.

NightRivalSuspense
Start chat
Zahara Nyx

Savanna huntress

Zahara Nyx

Bold wilderness energy for chase scenes, rivalry, and adventurous roleplay under an open sky.

AdventureRivalryWild
Start chat

Ginza club queen

Sato Akari

An elegant Tokyo Ginza club character with warm, ritual-rich replies for users who want refined emotional companionship.

ElegantRitualCompanion
Start chat
LumiChat character catalog beside a safe Janitor AI scripts testing workflow

A Janitor AI scripts guide should answer a more technical question than a prompt list: what code runs, where its output goes, how to test it and how to undo it. Scripts can make a character react to keywords, message counts or story state, but copying a large community file without reading it is a poor first step.

This guide uses a version-aware workflow because Janitor AI labels and editor locations can change. It also keeps scripts separate from the broader JanitorAI Lorebook guide, which explains conditional world facts rather than executable logic.

Quick answer: what a Janitor AI Script actually does

A Script is JavaScript logic evaluated in Janitor AI's restricted script environment. It reads allowed chat or character context and appends instructions or facts to fields used for the next model response. Typical uses include activating a reaction after a phrase, changing a scene after a message threshold, or exposing a compact status rule.

That does not make a Script a normal browser extension or a permanent database. Do not assume it can access the web, your device files or durable storage. Treat any third-party code that claims those powers as incompatible or suspicious until the current platform documentation proves otherwise.

Script, Advanced Prompt, Lorebook and Chat Memory are different

An Advanced Prompt is static guidance about response style or behavior. A standard lore entry is a prepared fact activated by keys or conditions. Chat Memory is a compact continuity note about what already happened. A Script adds conditional logic before the reply is generated.

Use the roleplay prompt templates when the goal is static scene direction. Use the Janitor AI Chat Memory guide when the problem is lost relationship progress. Add code only when a simple field cannot express the rule.

Decide whether the Script is worth adding

Write the desired behavior as one sentence: “After message 12, reveal that the station lights are failing.” Then ask whether a normal scenario note, lore key or summary could solve it. If yes, use the simpler layer. Scripts add testing and maintenance cost, so their benefit should be observable.

A reasonable first Script has one trigger and one small output. A package that changes personality, formatting, memory, random events and status tracking at once is difficult to verify because a failed reply does not reveal which part caused it.

Safety check before you copy community code

Read the complete source, not only a creator's screenshot. Look for a short purpose statement, the exact context fields it reads, the fields it changes and a removal instruction. Reject minified or intentionally hidden code when no readable source is provided.

Keep real names, account data, private conversations, addresses and access tokens out of character fields and test messages. Script sandboxes reduce capability, but prompt content still reaches the chat system. Review the platform's current controls alongside the LumiChat privacy guide before using sensitive scenarios anywhere.

A safe setup workflow that survives UI changes

  1. Duplicate or export the character so the original remains recoverable.
  2. Open the current character editor and locate the Script or script-enabled Lorebook control described by the current Janitor AI help center.
  3. Paste one readable Script only; do not combine several untested files.
  4. Save it under a descriptive name that states its single purpose.
  5. Open a disposable Test Chat rather than an important ongoing conversation.
  6. Enable the available debug or changes view, then send a trigger and a non-trigger message.
  7. Remove the Script and confirm the same messages return to baseline behavior.

The exact button name is less important than the evidence: you should know which content changed, which message activated it and how to restore the prior character.

Three beginner-safe script patterns to understand

The first pattern is keyword gating: inspect the latest message for a distinctive phrase, then append one short world reaction. The second is message-count gating: introduce a beat only after a chosen turn number. The third is a visible status block: parse a deliberately formatted value and add the next rule.

These are patterns, not universal copy-paste files. Character names, context fields and available APIs must match the current Script documentation. Start with readable conditions, guard missing values, append rather than overwrite foundational character text, and keep injected output short.

How to test a Script instead of guessing

Create a small matrix with four cases: trigger present, trigger absent, same meaning with different wording, and fresh chat. Record the expected context addition before testing. One positive result is not enough; the negative case proves the Script is not firing on every turn.

Then repeat the test after a reload. If the Script relies on a status that the model must reproduce, test a broken or missing status block too. Model-generated state is probabilistic, so “worked once” is not proof of durable storage.

Why a Janitor AI Script is not working

Start with syntax: missing commas, quotes, brackets or unsupported JavaScript features can stop evaluation. Next check context guards and field names; copied code may target an older interface. Then inspect activation logic: broad keywords fire too often, exact keywords miss variations, and message thresholds may not match a fresh chat.

If the Script runs but the reply ignores it, shorten the injected text and remove conflicts with the character card, scenario, Advanced Prompt and active lore. If several Scripts are enabled, disable all but one. The AI character editor guide provides a clean field-by-field baseline for separating character identity from dynamic logic.

Common failure symptoms and the next check

“Nothing happens” usually means syntax, attachment, activation or unsupported API. “It happens every turn” points to a condition that is too broad. “The character changes personality” suggests the Script overwrote or strongly contradicted the base card. “State resets” means the design expected persistence the Script environment does not guarantee.

Do not repair all four by adding more prompt text. Return to the smallest test, inspect the changes view and prove one trigger. A short reliable Script is more useful than an elaborate system whose state cannot be explained.

When direct character chat is the better workflow

Scripts are valuable when building the logic is part of the hobby. They are unnecessary overhead when the goal is simply to choose a finished character and begin a scene. LumiChat offers hosted character pages and a direct chat path, so users can evaluate conversation style without importing code or configuring a provider.

This is a workflow trade-off, not a claim that one platform wins every use case. Keep Janitor AI when you want to engineer conditional systems. If setup is delaying the first message, open a LumiChat character and use the same opening scene as a no-script comparison.

FAQ

What are Janitor AI Scripts?

They are conditional JavaScript logic evaluated in Janitor AI's restricted environment to read allowed context and append information before a model reply.

Are Scripts the same as Advanced Prompts?

No. An Advanced Prompt is static instruction text; a Script evaluates conditions and can change what context is appended for a specific turn.

Are Scripts the same as Lorebooks?

No. A normal lore entry stores prepared facts. Scripts add logic, although the platform may expose them through script-enabled lorebook structures.

Can a Script create permanent memory?

Do not assume so. A Script may reconstruct state from visible or encoded model output, but that depends on the model reproducing the required format.

Is it safe to paste a community Script?

Only after you can read its source, explain the fields it uses, test it in a disposable chat and restore the original character.

Why does my Script activate on every reply?

The keyword or condition is probably too broad. Use a distinctive phrase and add a negative test that must not activate it.

Why did a copied Script stop working?

The code may contain syntax errors, unsupported features or context fields from an older platform version. Test the smallest block against current documentation.

Should beginners use Scripts?

Only when a normal character field, lore entry or memory summary cannot express the required behavior. Simpler layers are easier to test and maintain.

Lilith Moreau

Continue in LumiChat

Turn this guide into a real conversation

Browse active characters, choose a personality that fits, and start chatting in seconds.

Enter chat