Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #27 // Test chat-bot personality. Asks for user name and then says Hi with name.

Lua code

--log("Name: " ..tostring(cookies.name)..", input: "..tostring(input))

if input ~= "" and cookies.name == nil then
  cookies.name = input
end

--log("Name: " ..tostring(cookies.name))

if cookies.name then
  return("Hello "..cookies.name.."!")
else
  return "What's your name?"
end

Author comment

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

Image recognition results

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: 1335 / 517
Referenced in: #28 - Writing chat-bots in Lua
#1000322 - YouTube source code for bug fixing DownloadHelper
#1028492 - style.css for ContractBox (extended with new-changes.css + progress bar + glowing)
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000238 - Answer for stefanreich (>> t power bot)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000505 - Smart Bot's answer to: !eval wikipedia("Captain America")