DEV Community

Cover image for Making a chatbot in PictoBlox
Krishna Agarwal
Krishna Agarwal

Posted on

24 1 1 1

Making a chatbot in PictoBlox

Walkthrough for making a chatbot in PictoBlox

In this tutorial, we will make a chatbot in PictoBlox. We will use conditional statements to make the chatbot respond to the user's input.

Getting Started

First, download and install PictoBlox from here.

Launch PictoBlox and choose the Block Coding mode.

Image description

Now, let's start making the chatbot!

Making the chatbot

First, let's make the chatbot greet the user.

Drag and drop the when flag clicked block from the Events palette.

Next, drag and drop the say block from the Looks palette, write Hello! I'm your chatbot. How can I assist you today? in the text field and place it under the when flag clicked block.

Image description

Now, let's make the chatbot respond to the user's input.

Drag and drop an ask and wait block from the Sensing palette into the "forever" block. This block will allow the user to input their message.

Enter the question: "How can I help you today?"

Drag and drop an "if" block from the Control palette below the "ask and wait" block.

Drag and drop a "contains?" block from the Operators palette into the condition slot of the "if" block.

Place the "answer" block from the Sensing palette into the first slot of the "contains?" block.

Enter the keyword "symptoms" in the second slot of the "contains?" block.

(You can add the name of the symptoms like "fever", "cough", etc. in the "say" block.)

Drag and drop a "say" block from the Looks palette inside the "if" block.

Add the say block for the chatbot to send the details of the symptoms and treatments.

You can add more "if" blocks for the chatbot to respond to more keywords.

Now, To make the chatbot say goodbye to the user.

Drag and drop the say block from the Looks palette, write Goodbye! in the text field and place it under the if block.

Final Look:

Image description

That's it! We have successfully made a chatbot using conditional statements in PictoBlox!

You can also refer to this related tutorial: Make a Chatbot using PictoBlox using Speech Recognition

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 🕒

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs