chatbot?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
chatbot?
Hello, I want to programme a ARG Game. For that I need a chatbot system. I simply "fake" chat box where the user can type in messages. If a message contains a "trigger word" the chat should give out a information. Example below.
User: Hello, anybody here?
User: Nobody ??
User: I have information about Cortexiphan
(Cortexiphan is the trigger word)
Fakeuser: Hello, ok what do you know about Cortexiphan
Can anybody code me a short example how to create something or is it not possible in LC? Thank you very much.
User: Hello, anybody here?
User: Nobody ??
User: I have information about Cortexiphan
(Cortexiphan is the trigger word)
Fakeuser: Hello, ok what do you know about Cortexiphan
Can anybody code me a short example how to create something or is it not possible in LC? Thank you very much.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: chatbot?
Do you need an actual chatbox system (multiuser, server/client, internet-enabled, etc)? or just a self-contained system on a computer where the user types something in and your program generates a reply locally?
If it's the latter, then you can check a list of trigger words easily with something like
(code in the script of the chat field)
If it's the latter, then you can check a list of trigger words easily with something like
(code in the script of the chat field)
Code: Select all
constant triggerWords = "Cortexiphan, bebop, the prime directive, sleep apnea"
on returnInField
repeat for each item trigger in triggerWords
if trigger is in me then
-- do something here
put "Hello, ok what do you know about" && trigger & cr after field "chat"
end if
end repeat
end returnInField
Re: chatbot?
Thank you very much I will try that it. Is a real chat system possible with LC? That would add more realism to the game if other ppl are aswell in the chatroom
Re: chatbot?
Oh and it is possible that the Text from the chat is not visible 100% directly . It should be look like someone type it .. letter for letter in a slow order.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: chatbot?
Yes, but it's much more involved. Bjornke has a full client/server chat system up that we use for real-time interactions. But the coding (especially the internet socket handling) is not for the faint of heart. Don't rule it out yet, but think of it as something to build towards. I'd say get the local system working first and then think about expanding it.Is a real chat system possible with LC?
http://www.bjoernke.com/index.irev?target=chatrev
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: chatbot?
Instead of the line I typed earlierletter for letter in a slow order.
Code: Select all
put "Hello, ok what do you know about" && trigger & cr after field "chat"
Code: Select all
repeat for each char tchar in ("Hello, ok what do you know about" && trigger)
put tchar after field "chat"
wait random(1000) milliseconds
end repeat
put cr after field "chat"