Start Template
The start template is the simplest possible bot - a greeting flow that demonstrates the core interaction pattern of BASIC: greeting users and responding to their input.
Topic: Basic Greeting & Help Flow
This template is perfect for:
- Learning BASIC fundamentals
- Simple FAQ bots
- Quick demos
- Starting point for more complex bots
The Code
REM Basic greeting and help flow
SET user_name = "Guest"
TALK "Hello, " + user_name + "! How can I help you today?"
HEAR user_input
IF user_input = "help" THEN
TALK "Sure, I can assist with account info, orders, or support."
ELSE
TALK "Sorry, I didn't understand. Type 'help' for options."
END IF
Sample Dialogs
These conversations show how the start template works in real-world scenarios.
Dialog 1: User Asks for Help
π€
Helper Bot
online
Today
Dialog 2: Unknown Input
π€
Helper Bot
online
Dialog 3: Personalized Greeting (Enhanced Version)
When you add user detection, the experience improves:
π€
Smart Helper
online
Keywords Used
| Keyword | Purpose |
|---|---|
SET | Assign a value to a variable |
TALK | Send a message to the user |
HEAR | Wait for and capture user input |
IF/ELSE | Conditional branching based on input |
How It Works
- Variable Setup:
SETcreates a variable to hold the userβs name - Greeting:
TALKsends the welcome message - Input Capture:
HEARwaits for user response - Response Logic:
IF/ELSEdetermines what to say back
Enhanced Version
Hereβs the same template enhanced with LLM for natural understanding:
REM Smart greeting flow with LLM
SET user_name = "Guest"
TALK "Hello, " + user_name + "! How can I help you today?"
HEAR user_input
' Let LLM understand intent
intent = LLM "Classify this user message into one category: help, account, orders, support, other. Message: " + user_input
SWITCH intent
CASE "help"
TALK "I can assist with account info, orders, or support."
CASE "account"
TALK "Let me pull up your account information..."
CASE "orders"
TALK "I'll check on your recent orders..."
CASE "support"
TALK "Connecting you with our support team..."
DEFAULT
response = LLM "Respond helpfully to: " + user_input
TALK response
END SWITCH
Customization Ideas
Add User Detection
' Get user info if available
user_name = GET BOT MEMORY "user_" + user_id + "_name"
IF user_name = "" THEN
TALK "Hi there! What's your name?"
HEAR user_name
SET BOT MEMORY "user_" + user_id + "_name", user_name
END IF
TALK "Welcome back, " + user_name + "!"
Add Quick Reply Buttons
ADD SUGGESTION "Account Info"
ADD SUGGESTION "My Orders"
ADD SUGGESTION "Get Support"
TALK "What would you like help with?"
HEAR choice
Add Time-Based Greeting
hour = HOUR(NOW())
IF hour < 12 THEN
greeting = "Good morning"
ELSE IF hour < 18 THEN
greeting = "Good afternoon"
ELSE
greeting = "Good evening"
END IF
TALK greeting + ", " + user_name + "!"
Related Templates
- enrollment.bas - Multi-step data collection
- auth.bas - User authentication patterns