LoreScript · Chazz.ai
How lorescript works on Chazz.ai. A small language that lets a lore entry decide for itself when to fire and what to say. A keyword list covers a lot, but not everything. LoreScript lets an entry look at the whole conversation, remember things between turns, count, roll dice, and build...
A small language that lets a lore entry decide for itself when to fire and what to say.
A keyword list covers a lot, but not everything. LoreScript lets an entry look at the whole conversation, remember things between turns, count, roll dice, and build its text on the fly. Keyword entries still work exactly as before. A script is something you add when you want it.
The smallest useful script
A `when` block runs its body whenever the condition is true; `emit` adds text to the prompt.
Two places to write one
Functions defined in the pack script are not visible inside entry scripts, because each runs on its own. If several entries need the same helper, put the logic in the pack script and have it emit or set world state that the entries read.
- Entry script: Belongs to one entry. Decides whether that entry fires and what it says.
- Pack script: Runs once per turn, before the entries. Use it for shared setup and for rules that span several entries.
Controlling where the text lands
A bare emit("…") puts the text into the transcript one line back, attributed to the system. That is the strongest default: it sits closest to the end of what the model reads, and depth 1 keeps your own message last.
emit also takes an options object, and position moves the text between the same slots the rest of the pack uses. See Lore packs for what each position means:
Reading the situation
A script can see the conversation it is running in:
The full reference for every name a script can reach lives in the editor itself. Hover any name for its signature, summary and examples. See The lore studio.
- message: The newest user message, exactly as typed.
- scanText: The whole window the engine scanned, so you can look further back.
- chat.turn · chat.messageCount: How far along the conversation is.
- chat.platform: Where it is running: solo, multiplayer, campaign or preview.
- chat.lastUser · chat.lastAssistant: The most recent line from each side.
- chat.history(n): The last n messages as a list of role, name and text.
- chat.mature: Whether this conversation is licensed for restricted content.
- world: State you set yourself, which survives between turns.
Elsewhere on Chazz.ai
- Explore characters
- About
- Features
- Pricing
- Use cases
- Integrations
- Compare
- Documentation
- FAQ
- Changelog
- API
- Security
- Status
- Contact
- Press
- Stories
- Marketplace
- Image generation
- Credits and plans
- Chat app connectors
- Terms
- Privacy
- AI transparency
- Notice to AI agents
This document is the server-rendered form of /docs/lorescript. The interactive page needs JavaScript, and shows the same content.
The complete documentation of this service is available as one plain-text file at /llms-full.txt. A short summary, with the operator's policy for automated readers, is at /llms.txt. Changes are published as a feed at /rss.xml.
Chazz.ai is operated by Cognitive Industries, ABN 62 794 528 747, Australia. Contact: [email protected].