Xartashah
English
| online |
Aerielle Kiyori
English
| offline |
Anomelli Mellow
English
| offline |
Glaznah Gassner
English, Russian
| offline |
Kaitlynn Rizzo
English
| offline |
Makaylah Wurgle
English
| offline |
NealB
English, Hindi
| offline |
Rehnaeaislinn
English
| offline |
Sammyredfire
English
| offline |
TwixiChardonnay
English
| offline |
show offline managers | |
English, Hindi, Russian |
SBSL Commands |
Have a question? Ask at SmartBots DevPortal!
DevPortal is a blog and forum for developers. Ask your questions to get a prompt reply!
Does HTTP POST request to a specific URL and returns a reply.
Very flexible command which allows easily extending your bot's functionality to no limits.
http_query URL QUERY-PARAMS
The following table explain the entries of the command:
Entry | Description |
---|---|
URL | the URL to call |
QUERY-PARAMS | URL-encoded values to post to the URL. Looks like a usual query string: action=check&item=XXX (without quotes) |
The command waits for a reply from the URL and puts this reply to $http_reply variable. This value can be used in subsequent commands.
This command is very useful when you need to extend the bot's functionality using PHP, Perl or any other script.
SBSL interpreter calls the given URL using a POST request. The query string must be properly encoded.
http_query parameters does not accept any variables (thus, you can't write "action=check&uuid=$speaker_uuid").
Instead, all event variables (like $speaker_uuid, $message and others) are automatically added to the query params, you don't need to pass them manually.
For example, this call
instant_message { http_query http://www.mysmartbots.com/sbsl/processor.php action=check&item=123 }
passes the following variables to your HTTP script:
You may use HTTP API functions to control your bot from the web script invoked by http_query.
See the examples for more info.
Gives resident a notecard (or whatever else) when resident starts talking with bot:
start_typing { # Check if we know this resident. We pass "action=check", and other # event variables will be added automatically. http_query http://www.mysmartbots.com/sbsl/processor.php action=check # Processor returns NEW if we don't know this resident if $http_reply == NEW im $speaker_uuid Hello $speaker_name! Please read our rules. give_inventory $speaker_uuid 3b65a122-8f77-64fe-5b2a-225d4c490d9c # Save this resident's visit http_query http://www.mysmartbots.com/sbsl/processor.php action=save else im $speaker_uuid Hello $speaker_name! Nice to meet you again! endif }