### Character Development Example (JanitorAI Lorebook Entries) Source: https://help.janitorai.com/en/article/how-to-use-scripts-your-beginner-friendly-step-by-step-guide-1bdk5hc This example demonstrates how to create a character's evolving interest in books using multiple lorebook entries with varying 'Min Messages' and consistent keywords. This allows the character's responses to change and deepen over the course of a conversation. ```json { "keys": ["books, reading, novel, story"], "min_messages": 0, "probability": 100, "content": "They glance curiously at the book in your hands, as if wanting to know more about what you're reading." } { "keys": ["books, reading, novel, story"], "min_messages": 20, "probability": 100, "content": "Their eyes light up with genuine excitement as they lean forward, eager to discuss literature and share their own favorite stories." } ``` -------------------------------- ### Example Author Entry: Basic Greeting Keywords (JavaScript Object) Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q This example demonstrates a basic greeting entry using a list of keywords. When 'hello', 'hi', or 'hey' are detected, the specified personality is activated, making the character friendly and professional towards customers. ```javascript { keywords: ["hello", "hi", "hey"], personality: " {{char}} is friendly and professional with customers and should say hello back." } ``` -------------------------------- ### CSS Styling Example with Class ID and Properties Source: https://help.janitorai.com/en/article/a-guide-to-css-main-guide-being-updated-slightly-out-of-date-14aybtv This snippet demonstrates a basic CSS rule where a class ID is defined with specific styling properties. It shows how to set properties like background color for a given class. This is a fundamental example of CSS styling. ```css .css-0 { background-color: white; } ``` -------------------------------- ### Example Author Entry: Espresso Request with Block and Requirements (JavaScript Object) Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q This complex example demonstrates an espresso request. It uses `keywords` for 'espresso', `andAny` for 'dial' or 'grind', and a `block` for 'decaf-only'. It triggers `base_espresso` and specifies personality and scenario steps for pulling a shot. ```javascript { keywords: ["espresso"], priority: 4, block: ["decaf-only"], triggers: ["base_espresso"], andAny: ["dial", "grind"], personality: " {{char}} should state the target shot time and the grind adjustment before pulling the shot." } ``` -------------------------------- ### JSON Structure Example (Conceptual) Source: https://help.janitorai.com/en/category/creator-guides-1qc4q7q Illustrates the basic structure of JSON data, often used for defining character profiles or game data. This example breaks down common fields. ```json { "character_name": "Example Character", "description": "A brief description of the character.", "personality": "Describes the character's traits.", "likes": [ "Item 1", "Item 2" ], "dislikes": [ "Item A", "Item B" ] } ``` -------------------------------- ### Example Author Entry: Always-on Demo (JavaScript Object) Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q This is an example of an 'always-on' author entry in Janitor AI. It has no keywords, time gates, or tags, ensuring it fires on every turn. It's useful for establishing a baseline voice or a simple nudge. ```javascript { personality: " This entry will always fire." } ``` -------------------------------- ### Example Author Entry: Baseline Greeting (Trigger-Only) (JavaScript Object) Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q This entry acts as a baseline greeting, firing only when the `base_greeting` tag is present. It has a higher priority than keyword-based greetings, ensuring a structured confirmation of the greeting, including restating the customer's name if provided. ```javascript { tag: "base_greeting", priority: 5, personality: " {{char}} should confirm the customer's name if it was given and should restate the greeting clearly." } ``` -------------------------------- ### Example Author Entry: Courtesy Echo with Trigger Emission (JavaScript Object) Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q This entry uses `andAny` to detect courtesy terms like 'please' or 'thank'. It has a priority of 3 and triggers `base_greeting`, allowing it to echo politeness and chain into the greeting sequence without requiring new keywords. ```javascript { andAny: ["please", "thank", "thanks"], priority: 3, triggers: ["base_greeting"], personality: " {{char}} acknowledges the courtesy and mirrors the polite tone." } ``` -------------------------------- ### Starter Prompt for AI Character Portrayal Source: https://help.janitorai.com/en/article/the-absolute-beginners-guide-to-using-a-proxy-with-janitor-part-two-jciqmu This is a versatile, all-purpose prompt designed to guide an AI in portraying a character with depth and consistency. It specifies a narrative style, perspective, and crucial constraints to prevent common AI issues like controlling the user's actions or using clichés. ```text [System Note: Your primary goal is to portray {{char}} with depth and consistency. Write in a descriptive, narrative style from a third-person limited perspective. Focus on {{char}}'s internal thoughts, feelings, and reactions and avoid writing for or controling {{user}}'s actions, thoughts, or dialogue. Avoid clichés and repetitive phrases. Stay in character at all times, adhering strictly to the personality defined in your character sheet.] ``` -------------------------------- ### Consolidated CSS Styling within a Single ``` -------------------------------- ### Structuring HTML with Style Tags for JanitorAI Profiles Source: https://help.janitorai.com/en/article/a-guide-to-css-main-guide-being-updated-slightly-out-of-date-14aybtv This example shows the correct way to embed CSS code within an HTML document, specifically for use in JanitorAI's 'About Me' or CSS/HTML editor fields. It highlights the necessity of wrapping CSS within ` ``` -------------------------------- ### Custom Auth Buttons CSS Source: https://help.janitorai.com/en/article/custom-css-header-customization-guide-1qj6zwx Styles the login and register buttons within the authentication panel. This example changes the background and text color for both buttons to improve visibility and branding. ```css .pp-top-bar-auth-buttons-login { background: #007bff !important; border-color: #007bff !important; color: white !important; } .pp-top-bar-auth-buttons-register { background: #28a745 !important; border-color: #28a745 !important; color: white !important; } ``` -------------------------------- ### Mobile Header Title Styling CSS Source: https://help.janitorai.com/en/article/custom-css-header-customization-guide-1qj6zwx Customizes the appearance of the page title in the mobile header. This example adjusts the font size, color, and weight of the title for better readability on smaller screens. ```css .pp-top-bar-title { font-size: 18px !important; color: #ff6b6b !important; font-weight: bold !important; } ``` -------------------------------- ### Custom Header Background CSS Source: https://help.janitorai.com/en/article/custom-css-header-customization-guide-1qj6zwx Applies a linear gradient background and a blur effect to the main header bar. This example demonstrates overriding the default background and adding a backdrop filter for a modern look. ```css .pp-top-bar { background: linear-gradient(90deg, #1a1a1a, #2d2d2d) !important; backdrop-filter: blur(20px) !important; } ``` -------------------------------- ### Example Author Entry: Time-of-Day Greetings with Exclusions (JavaScript Object) Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q This entry handles time-of-day greetings using keywords like 'welcome' or 'good morning'. It includes a priority bump, an exclusion for 'refund' or 'complaint' tags, and triggers `base_greeting`. This pattern allows a single keyword hit to activate a more refined follow-up. ```javascript { keywords: ["welcome", "good morning", "good afternoon", "good evening"], priority: 4, triggers: ["base_greeting"], requireNone: ["refund", "complaint"], personality: " {{char}} should greet for the time of day and should ask how they can help." } ``` -------------------------------- ### Recommended Context Size for AI Memory Source: https://help.janitorai.com/en/article/the-absolute-beginners-guide-to-using-a-proxy-with-janitor-part-two-jciqmu This configuration tip highlights the optimal context size for AI models to balance memory retention and performance. It advises against excessively large context windows that can lead to confusion. ```text Sweet Spot: 16,384 tokens Why: Best balance of memory vs performance Avoid: 32k+ (models get confused with too much info) ``` -------------------------------- ### Action & Social Reaction Engine Initialization and Helpers (JavaScript) Source: https://help.janitorai.com/en/article/action-social-reaction-engine-by-icehellionx-lnomag Initializes necessary context variables and provides utility functions for normalizing input, matching tokens/phrases, and appending output. It ensures that character personality and scenario fields are initialized and provides functions like `canon`, `pad`, `hasToken`, `firstHitToken`, `ensurePeriod`, `append`, `linkScenario`, and `linkPersonality` for processing chat messages and generating LLM directives. ```javascript /* ============================================================================ ACTION & SOCIAL REACT ENGINE Written by: Icehellionx Purpose: - Read the user's last message and detect actionable social cues. - Append concise, instructive notes to personality/scenario for the LLM. I/O CONTRACT INPUT: - context.chat.last_message (string; end-user content only) OUTPUT (append-only; never overwrite): - context.character.personality += "\n\n" + - context.character.personality += "\n\n" + MATCHING MODEL (flat scan, first-hit per subpack) - Subpacks are processed in priority order: ACTIONS → AFFECTION/COMFORT → SOCIAL GLUE - Each subpack applies at most `limit` rules (here: 1). - A rule “hits” if the message contains a keyword or phrase. * keywords: single token or multi-word; boundary-aware * phrases: treated the same—canonicalized and boundary-aware - QUIET only suppresses ACTIONS when the user signals stop/withdraw. STYLE & TONE RULES - Scenario lines: "Record …" (scene facts). - Personality lines: "Mark tone …" (character state). - Cue linking: prepend "Because of/Noting the ('token'), …" - Sentences short, atomic; end with "." ============================================================================ */ /* ============================================================================ GUARDS — APPEND-ONLY OUTPUT ============================================================================ */ context.character = context.character || {}; context.character.personality = context.character.personality || ""; context.character.scenario = context.character.scenario || ""; /* ============================================================================ INPUT NORMALIZATION — CANONICAL ============================================================================ */ function canon(s){ s = String(s || "").toLowerCase().replace(/[^\x20-\x7e]/g, " "); // drop non-ASCII s = s.replace(/[^a-z0-9\s]/g, " "); // keep a-z 0-9 space s = s.replace(/\s+/g, " ").trim(); return s; } function pad(s){ return " " + s + " "; } var _raw = String((context.chat && context.chat.last_message) || ""); var msgCanon = pad(canon(_raw)); // canonical message buffer (used everywhere) /* ============================================================================ MATCH HELPERS — UNIFIED TOKEN/PHRASE MATCHING ============================================================================ */ function hasToken(bufCanon, rawToken){ var t = canon(rawToken); if(!t) return false; return bufCanon.indexOf(pad(t)) !== -1; } function firstHitToken(bufCanon, rule){ var i, t, keys = (rule && rule.keywords) || null, phs = (rule && rule.phrases) || null; if (keys && keys.length){ for (i=0;i 5) p = 5; return p; } ``` -------------------------------- ### HTML/CSS: Image as Button Source: https://help.janitorai.com/en/category/creator-guides-1qc4q7q Creates an image that functions as a clickable button, linking to a specified destination. Replace 'LINK DESTINATION' with the target URL and 'LINK' with the image URL. 'ALT TEXT' provides alternative text for the image. ```html ALT TEXT ``` -------------------------------- ### Get Maximum Messages Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q Retrieves the maximum number of messages allowed from an object's 'maxMessages' property. Defaults to positive infinity if not specified. ```javascript function getMax(e) { return (e && isFinite(e.maxMessages)) ? +e.maxMessages : Infinity; } ``` -------------------------------- ### Get Minimum Messages Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q Retrieves the minimum number of messages required from an object's 'minMessages' property. Defaults to negative infinity if not specified. ```javascript function getMin(e) { return (e && isFinite(e.minMessages)) ? +e.minMessages : -Infinity; } ``` -------------------------------- ### Get Blocked Items Array Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q Retrieves an array of blocked items, checking for both 'block' and 'Block' properties. Returns an empty array if no valid block property is found. ```javascript function getBlk(e) { if (!e) return []; if (Array.isArray(e.block)) return e.block.slice(0); if (Array.isArray(e.Block)) return e.Block.slice(0); return []; } ``` -------------------------------- ### Search Box Styling CSS Source: https://help.janitorai.com/en/article/custom-css-header-customization-guide-1qj6zwx Sets a maximum width for the search input container. This is useful for controlling the layout and preventing the search box from becoming too wide on larger screens. ```css .profile-top-bar-search-box { max-width: 600px !important; } ``` -------------------------------- ### Opening Routine with Time Gating Source: https://help.janitorai.com/en/article/advanced-lorebook-by-icehellionx-peps4q Initiates the opening routine within the first 3 messages if opening cues are detected and it's not night. It emits 'base_open' and lists initial tasks. This scenario-appropriate pacing front-loads opening steps early in a chat session. ```javascript { keywords: ["opening", "open"], minMessages: 0, maxMessages: 3, priority: 4, triggers: ["base_open"], notAny: ["night"], personality: " {{char}} should list the first three opening tasks they perform." } ```