The Book of AI

How To Build Chatbots with The Personality Forge
Chapters
Chapter 7: AIScript

AIScript is The Personality Forge's AI scripting language. It gives you even more control over Memories, Emotions, and Responses. You can store literally anything as a memory, and retrieve those memories at any point. You can also set a wide range of conditions on Responses so that they only come up at specific times, you can fine-tune emotional reactions, and more.

Writing AIScript

AIScript is made up of one or more "statements" separated by semicolons. A statement is a series of words that tells the AI Engine what to do.

Where To Put AIScript

There are three kinds of AIScript: Initialization, Keyphrase (or Seek), and Response.

Initialization: Initialization AIScript can be put in the "AIScript Initialization" box on the Chatbot's Settings page.

Keyphrase: Keyphrase (or Seek) AIScript goes in the AIScript box that appears underneath a Keyphrase when you click "more" on the add/edit page.

Responses: Response AIScript goes in the AIScript box that appears underneath a Response when you click "more" on the add/edit page.

Multiple AIScript Statements

AIScript statements can be strung together, and they are processed from left to right. Here is an example of what a Response with an AIScript might look like:

Response: So, boyfriend, can I call you 'cute buns'?
AIScript: if male; if emotion > 2; remember "cute buns" as "nickname";

You'll learn more about these AIScript statements later.