Longer scripts are necessarily more challenging to follow and visualize. We recommend that you include portions of your bot script that you expect to repeat inside a Jump Bucket (like a subroutine) and then use the Jump tool (detailed below) throughout your script to jump to the Jump Bucket and back as needed. The Jump Bucket and Jump tools can be found towards the bottom of the right hand panel of the Gobot builder.
Jump Bucket - Bots with many different branches often repeat script elements, which makes your bot script unnecessarily long and harder to follow. For example, if your bot has a branched Quick Replies with 10 reply options and you plan to ask your website visitor for contact information in the first 5 of the branches, you should seriously consider creating a Jump Bucket (named Contact Info, for example) in the first branch and jump to this Jump Bucket in each of the other 4 branches.
Start by dragging the Jump Bucket element from the right hand panel into the center panel. The Jump Bucket looks similar to a Quick Replies branch. Next, name your Jump Bucket in the right hand panel and click Save. As you will be jumping to your Jump Bucket later it is helpful that you choose a name representative of the Jump Bucket's function, i.e., Contact Info. Next, place chat elements inside the Jump Bucket as you would in a Quick Replies branch. In our Contact Info example, you might want to include an Email Field for email addresses and multiple Text Field's for first name, last name, address, telephone number, etc. Now that your Jump Bucket is complete you can jump to it at any point of your script where you might want to solicit contact information (without having to repeat all of this scripting!). For this you will need to rely on the Jump tool discussed below.
Jump - Use the Jump tool to jump in and out of Jump Buckets in your script. In the above example, you would drag the Jump button from the right hand panel into your second Quick Replies branch, and then in the right hand panel indicate the particular Jump Bucket you want to jump to (in this case called Contact Info). You will want to do this for each of the other Quick Replies branches where you want to solicit contact information. Once the script reaches the Jump in the second Quick Replies branch it will jump to the script elements in the Contact Info Jump Bucket and then return to second branch of the Quick Replies right after the Jump element and continue with any remaining chat elements in that branch.
You can also use a Jump to jump back to the beginning of a bot script rather than jumping into a Jump Bucket.
Main Menu - Many bot scripts include a menu of options towards the beginning of the script. If you are going to want to return to your main menu multiple times throughout your script, we recommend that you include your menu in a Jump Bucket rather than recreate it multiple times. Place a Jump in your bot script everywhere you want to jump to your Main Menu.
Copyright 2017-2018, Gobot LLC, All rights reserved.