-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample.twee
72 lines (41 loc) · 1.71 KB
/
sample.twee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
:: StoryTitle
Test
:: StoryData
{
"ifid": "3A31AA6F-EF9A-43B1-BF53-08AF770247A8",
"format": "TEST_Botscripten",
"format-version": "0.5.1",
"start": "Start",
"zoom": 1
}
:: Start [speaker-bot wait] {"position":"412,189","size":"100,100"}
Hey there!
I'm the chat bot, and this is a demo!
[[A demo?]]
:: A demo? [speaker-bot] {"position":"412,339","size":"100,100"}
Yep! A demo! With choices!
[[Choices are neat -> Choice Good]]
[[I'm not a fan -> Choice Bad]]
:: Choice Good [speaker-bot] {"position":"337,489","size":"100,100"}
#@set choice good
Oh, that's great! I like having choices too.
[[Directives]]
:: Choice Bad [speaker-bot] {"position":"487,489","size":"100,100"}
#@set choice bad
Oh no. Well, at least there was only one of them!
[[Directives]]
:: Directives [speaker-bot wait] {"position":"412,634","size":"100,100"}
See that block above with the #@ symbol? That's a directive.
Directives are how you can tell your scripting system to **DO** more than just chat like a bot.
In this case, we told our scripting engine we wanted to set the "choice" var.
[[Does it always go on one line?]]
:: Does it always go on one line? [speaker-bot] {"position":"412,784","size":"100,100"}
###@sql
SELECT * FROM users
WHERE username = "chatbot"
###
Not really. The above part is a "Block Directive" and everything inside is treated as a single statement.
[[So, how does it run?]]
:: So, how does it run? [speaker-bot] {"position":"412,934","size":"100,100"}
That's the fun part. It's up to you. Botscripten is meant to make it easy to put together guided conversations. You can use your own directive language to run queries, ask open ended questions, or do whatever techno-wizardry suits you.
Go forth and build!