Discuss Scratch

blah_blahYa
Scratcher
11 posts

How to make a Chatbot

Here is the basic code to start a Chatbot like mine: https://scratch.mit.edu/projects/963425025

when green flag clicked
say (join [Hi ] (join (username) [, I am (chatbot name) how can I help you?])) for (2) secs
forever
ask [] and wait
if <(answer) contains [hi] ?> then
say [hi]
else
if <(answer) contains [time] ?> then
say (join [The time is ] (current [time])) for (2) secs
else
say [Sorry, I didn't understand.] for (2) secs
end
end
end

This is the very basic code to get started, I hoped it helped.

Last edited by blah_blahYa (March 21, 2024 22:02:42)

Paddle2See
Scratch Team
1000+ posts

How to make a Chatbot

It's really nice that you want to help out with a guide! However, we have a number of them in the forums already and we don't have a good way to showcase any more. If you want to make a guide in a Scratch project, that would be fine. You could advertise it in the “Show and Tell” section too.

There are lots of other ways to help out in the forums too. Helpful Scratchers are always welcome in the “Questions About Scratch”, “Help With Scripts”, “Requests” and other sections. Just look around and ask questions

Scratch Team Member, kayak and pickleball enthusiast, cat caregiver.

This is my forum signature! On a forum post, it is okay for Scratchers to advertise in their forum signature. The signature is the stuff that shows up below the horizontal line on the post. It will show up on every post I make.
(credit to Za-Chary)



;

Powered by DjangoBB