Nocturnal hunter
Cassian Vale
Playful hunter-and-rival energy for users who prefer suspense, reversals, and a partner who pushes back.
Dynamic character logic, explained safely
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.
13 min read
Quick answer
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.
Featured companions
Three characters refresh on each visit. Cards play a promo video when available and otherwise show the character image.
Nocturnal hunter
Playful hunter-and-rival energy for users who prefer suspense, reversals, and a partner who pushes back.
Savanna huntress
Bold wilderness energy for chase scenes, rivalry, and adventurous roleplay under an open sky.
Ginza club queen
An elegant Tokyo Ginza club character with warm, ritual-rich replies for users who want refined emotional companionship.

Script types, safe setup, testing and fixes
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.
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.
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.
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.
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.
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.
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.
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.
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.
“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.
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.
They are conditional JavaScript logic evaluated in Janitor AI's restricted environment to read allowed context and append information before a model reply.
No. An Advanced Prompt is static instruction text; a Script evaluates conditions and can change what context is appended for a specific turn.
No. A normal lore entry stores prepared facts. Scripts add logic, although the platform may expose them through script-enabled lorebook structures.
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.
Only after you can read its source, explain the fields it uses, test it in a disposable chat and restore the original character.
The keyword or condition is probably too broad. Use a distinctive phrase and add a negative test that must not activate it.
The code may contain syntax errors, unsupported features or context fields from an older platform version. Test the smallest block against current documentation.
Only when a normal character field, lore entry or memory summary cannot express the required behavior. Simpler layers are easier to test and maintain.
Continue in LumiChat
Browse active characters, choose a personality that fits, and start chatting in seconds.
Find the AI companion that fits your mood
AI character editing guide
A field-by-field editing workflow with format checks and a repeatable chat test for stronger character cards.
Chat memory guide
A practical workflow for deciding what belongs in Chat Memory, Persona, recent history or a Lorebook—and testing whether the bot actually recalls it.
AI chat guide
A copyable six-part roleplay prompting template with examples, fixes, and a practical character-chat test.
World memory guide
A lorebook is conditional world knowledge, not unlimited long-term memory. Good entries inject one relevant fact when a precise key appears; bad entries fire constantly or never fire.