> For the complete documentation index, see [llms.txt](https://docs.idew.org/code-chatbot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idew.org/code-chatbot/warm-up-project-outline/3-get-familiar-with-rivescript.md).

# 3 Get Familiar with Rivescript

## Objective

Develop a chatbot script that demonstrates several useful features and patterns in programming a conversation.

{% hint style="warning" %}
Any direct links to headings within the Rivescript documentation no longer work. Therefore, you will want to do a search for a keyword in the browser to find the content. We will update this page if we find a better way to link directly to the desired location in the Rivescript documentation.
{% endhint %}

{% embed url="<https://www.loom.com/share/eb305934b4e34d41ab5dbb450345707f>" %}

## Instructions

Let's get familiar with the syntax of RiveScript and how it will provide the logic of your chatbot. For each item below carefully look at the documentation for RiveScript to understand the options available to you as you determine what is possible with your chatbot.

1. **Read first section of** [**The Code, Explained**](https://www.rivescript.com/docs/tutorial#the-code-explained) **in the Rivescript documentation.** Pay close attention to the "Important Note" in the reading that describes the importance of using lowercase with triggers.
2. **Create four** [**random replies**](https://www.rivescript.com/docs/tutorial#random-replies) **to "hello" for your chatbot.**
3. **Define a single trigger (a trigger is the user input that starts with a "+" in the script) that will respond to these two user questions** - "What do you do?" or "What can you do?" with a bot answer that you choose. For example, you could respond to the user with "I do very little at the moment." Hint: use the ["alternatives and optionals" in RiveScript](https://www.rivescript.com/docs/tutorial#alternatives-and-optionals).
4. Use [a redirection](https://www.rivescript.com/docs/tutorial#redirections) to your "hello" trigger when the user inputs "Hey". Basically, make your bot respond the same way to *hello* or *hey.*
5. **Create a reply to "My name is Sue" (or any name).** In your chatbot response, use the person's name---like, "Nice to meet you Sue, my name is ChattyBot." Hint: Use an [open-ended trigger with a wildcard](https://www.rivescript.com/docs/tutorial#open-ended-triggers).
6. **Have your bot kick-off the conversation with&#x20;*****a question*****&#x20;when it starts so the visitor knows how to continue the conversation.** Also, add the needed script to listen for a response to that question and respond. Take a look at [this example on short discussions](https://www.rivescript.com/docs/tutorial#short-discussions).
7. **Finally, choose two other features of RiveScript syntax to implement in your bot.**

## ✓ Deliverable

Have your chatbot working with the features described above and be prepared to demonstrate and explain how it works.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.idew.org/code-chatbot/warm-up-project-outline/3-get-familiar-with-rivescript.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
