| | Don't Have an Account? |
 |
Signup Now, It's FREE!
 |
Have an Account? Login Now! |
 |

| Members: | 25,415 |
| Members on AIM: | 90 |
|
 |
 |
Bot Variables ( Bot Profile, Setting and Getting Variables ): |
 |
Using your Bot's Profile Variables from BOT SETTINGS:
Before getting started it is a good idea to setup a profile for your bot of it's info, what it likes, etc... by clicking here. These variables can easily be used in your Bot's Responses for example:
Someone asks: What is your name? Bot replys: My name is Arthur The above example would require a bot response with: PATTERN of "what is your name" RESPONSE of "My name is <name/>" You would have also had to have set the <name/> bot setting to "Arthur" on the bot settings page. There are many more bot variables other than <name/>, visit the bot settings page to see them all, each field as it's corresponding RESPONSE TAG listed in bold.
Setting Variables (Bot Memory) :
Your bot is fully capable of remembering what epople have said to it, their characteristics, etc... Programming your bot to set variables is quite easy with the <SET name="variable name">variable data</SET> tag, for example:
Someone asks: I am a boy Bot replys:You are a he The above example would require a bot response with: PATTERN of "i am a boy" RESPONSE of "You are a <set name="gender">he</set>"
As you can see the SET tag will replace itself with the variable data. Under most circumstances this is not desired. To avoid this you will need to use the <THINK>...</THINK> tag which will hide the output of what is inside it ( as if your bot is "thinking" ), for example:
Someone asks: I am a boy Bot replys: How old are you? The above example would require a bot response with: PATTERN of "I am a boy" RESPONSE of "How old are you?<think><set name="gender">he</set></think>" Note! The above example has still set the person's variable "gender" to "he".
You may be saying that is all fine and dandy but how do I set the variable data to something that I collect with a wildcard ( * )? You can easly put the <STAR/> tag where the SET tag's variable data is in order to set the variable to something that you have collected with the wildcard ( * ), for example:
Someone asks: My hair is red Bot replys: I love red hair! The above example would require a bot response with: PATTERN of "my hair is *" RESPONSE of "I love <set name="hair_color"><star/></set>!" Note! The above example has set the person's variable "hair_color" to "red".
All of your stored variables can be viewed by visiting the "Messages" page under "Bot Memory".
Getting Variables (Bot Memory) :
What would be the point of setting variables if you couldn't use them later on. It is even easier to display variables that you set for a given person with the <GET name="variable name"/> tag. Here is an example run from the "hair color" one above. Assume we already set the person's "hair_color" variable to "red":
Someone asks: What color is my hair? Bot replys: Your hair is red The above example would require a bot response with: PATTERN of "what color is my hair" RESPONSE of "Your hair is <get name="hair_color"/>" Note! if the "hair_color" variable was not set the bot would have said "Your hair is Unknown"
Setting the TOPIC ( Module ) :
In order to use Modules as well as switch context via the bot's TOPIC field you will need to be able to set the topic. It is as easy as setting a variable above. The tag to place in your response would be <SET name="topic">topic name or module name</SET>. Say I have loaded a module named "WEATHER" and I want my bot to activate it when someone says "weather" for example:
Someone asks: weather Bot replys: What is your zip code? The above example would require a bot response with: PATTERN of "weather" RESPONSE of "What is your zip code?<set name="topic">WEATHER</set>" Note! the above example assumes you have a module named "WEATHER" loaded into your bot brain.
You will want to exit a topic or module sometime, in order to do this use this tag <SET name="topic"></SET>, which will basically clear out the topic variable.
Note! when creating modules or topics be sure to provide responeses in them with patterns like "* quit *" or "* exit *" so the user can always get back to bot's default context.
|
|
|
|
|