SmartbotPro
  • Smartbot Pro – messenger marketing tool
  • Most important
  • Mini-course
    • Registration and personal account
    • Initial scripting tools
    • Creating the first script
    • Users and collection of information
    • Applications, variables and managers
    • Data validation
    • Collection of applications for a webinar within Telegram
    • Testing unpublished scripts
    • Newsletters
    • Template "Test with a set of points"
    • Statistics
    • Interface hacks
  • Beginning of work
    • Registration in the service
    • More about scripts
    • How to add messenger
      • Adding Telegram
        • Adding a bot to a group chat in Telegram
      • Adding ВК
      • Adding Viber
      • Connecting a channel to a script
      • Linking a social network account
  • Scripts
    • Basics
      • Create a script
      • Script templates
      • Editor interface
      • Publishing a script
      • Script testing
      • How the script is chosen
    • Script events
      • Message from user
      • No appropriate script
      • First message
      • VK Events
      • Webhook
    • Actions
      • Send a message
        • Buttons
      • Process message
      • Extract data
      • Change context
      • Write to statistics
      • Send Notification
      • Switching to another script
      • Working with the user
      • Set variable
      • Scheduled transitions
      • Run SmartQuery
    • Conditions
      • Condition
      • Condition with options
      • Conditions of VKontakte
    • Variables
      • Special Variables
      • User variables
      • Global variables
      • Variable %ref%
    • Acceptance of payment
    • Telegram bot menu
    • Integrations
      • Google-таблицы
      • http request
      • amoCRM
      • Get Course
      • Yukassa for receiving payments
    • Reactions
  • Newsletters
  • Settings
    • Projects
    • Cabinets
  • Information sections
    • Statistics
    • Users
  • SmartQuery
    • Introduction
    • Language syntax
    • Function Reference
  • The documents
    • Privacy Policy
    • Terms of service
    • Subscription and rates
Powered by GitBook
On this page
  1. Scripts
  2. Basics

Create a script

In this section, we will look at the process of creating and running our own scripts.

PreviousBasicsNextScript templates

Last updated 2 years ago

Script is a sequence of steps that the bot performs in response to events, such as an incoming message in a messenger, joining a group on a social network, or paying for an item in your online store.

Before reading this section, we recommend that you familiarize yourself with the

To create a script, go to the "scripts" section through the menu on the left and click the "add script" button:

Enter a script name and click "create".

After that, you will be taken to a blank script creation screen. Take a look at the menu on the left:

  • Events are external influences that can trigger a scenario. For example, a message from a user

  • Actions are the steps that the bot performs in response to events

  • Conditions - you can set the conditions under which the logic of the dialogue can change. For example, if a person has already bought a product from you before, offer him another product

  • Variables - a list of available variables for use in scripts

  • Settings - scenario settings

Let's create a simple conversation chain where the bot will respond with the message "great" to the question "how are you?".

To do this, select "user input" in the events. An event block will be created on the scenario graph and its settings will open:

Pay attention to block settings.

You can specify the name of the event (so it will be easier to search for it on the graph), the condition for the user's message and additional settings.

Now it is enough for us to specify only the condition. We expect the user to ask "how are you". Let's add it to the message condition:

Great, now let's add the "send message" action. Select the "actions" section in the left menu and click on "send message". A block for sending a message will be added to the script graph and the settings will open:

We will consider the settings of the "send message" action in detail in other sections, but for now it is enough to enter the desired message. Write "excellent" in the message input field. After that, the script graph will look like this:

These blocks are not linked. To set the dialog sequence (event -> send message), hover over the event block. A circle will appear from which you can drag an arrow to the message send block:

The blocks are now connected. By the way, it was possible to link them through the "next block" setting in the event settings menu:

This can be convenient when the script graph is very large and it is difficult to drag an arrow from one block to another.

basic principles of scripting.