1 | --log("Name: " ..tostring(cookies.name)..", input: "..tostring(input)) |
2 | |
3 | if input ~= "" and cookies.name == nil then |
4 | cookies.name = input |
5 | end |
6 | |
7 | --log("Name: " ..tostring(cookies.name)) |
8 | |
9 | if cookies.name then |
10 | return("Hello "..cookies.name.."!") |
11 | else |
12 | return "What's your name?" |
13 | end |
Remembers user's name :)
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Recognizer | Recognition Result | Visualize | Recalc |
---|---|---|---|
#308 | 294 | [visualize] |
Snippet ID: | #27 |
Snippet name: | Test chat-bot personality. Asks for user name and then says Hi with name. |
Eternal ID of this version: | #27/1 |
Text MD5: | 9456df4ae3d022af5dfe11c209cbc7a1 |
Author: | stefan |
Category: | personalities |
Type: | Lua code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2013-12-21 12:48:37 |
Source code size: | 294 bytes / 13 lines |
Pitched / IR pitched: | Yes / Yes |
Views / Downloads: | 1444 / 555 |
Referenced in: | [show references] |