Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Chat Responses

Author
Message
Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 02:13
Alright, so say I have a certain 'bot' in my program that helps the [user] through things. Say I have a certain part of the program that lets [user] talk directly to the 'bot'. How would I make responses that are programmed into the bot to specifically say when the user says something (not caps-specific). Also, how would I implement random phrases if the bot doesnt have a specific saying for something the user says.

Any ideas would be greatly appreciated

---PARANOID PRODUCTIONS---
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th May 2007 02:50 Edited at: 24th May 2007 02:53
Depends on how you have it set up. I would use UDT's with arrays. Something like this:



EDIT: Added random responses.


Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 02:55
Could you use the OR command to add more triggers? Like this:

dialogue( 2 ).trigger = "Sup?" or "sup" or "sup man?" or "sup man"


?

---PARANOID PRODUCTIONS---
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th May 2007 03:00
No, or is only for "if" statements if I'm thinking correctly. What you could do is add another dimension, like this:



Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:00
That's another thing I tried, and it worked! Thanks for all the help! I just need to implement this into a function (can I?)

---PARANOID PRODUCTIONS---
Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:06 Edited at: 24th May 2007 03:13
How would I get random responses? (I mean programmed random, not random random - lol)

---PARANOID PRODUCTIONS---
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th May 2007 03:18
No problem . What do you need the function to do? You'd need most of your variables global if you're going to put them into a function. I'm confused on what you mean by random responses? Give me an example .


Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:19


---PARANOID PRODUCTIONS---
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th May 2007 03:23
Oh, I see what you mean . I would just use the other dimension for those too, then pick a random one to use from it, like this:



Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:24
I'm such a newbie to this, could you implement that with all the other code you have added (random stuff, etc etc)

---PARANOID PRODUCTIONS---
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th May 2007 03:26 Edited at: 24th May 2007 03:26
I did . I took out the old random thing cause you said it wasn't what you wanted . That should get it to where it prints one of 4 random responses to any 4 triggers.


Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:27
Alright, but what I mean is that without the old code it wont check if it doesnt have that trigger. I need that or it just skips and asks me to enter another message. Ah well.

---PARANOID PRODUCTIONS---
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th May 2007 03:31
Oh, okay, here it is with that added back in. All I'm doing is adding a trigger variable to read if it finds the command, and if that variable stays false, saying they don't know that command .




Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:32
I hate to keep bugging you, but how do I implement random "hasFound=0" messages? Man I really, really hate to keep asking for things. It isnt my nature.

---PARANOID PRODUCTIONS---
Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:35
nevermind, I'll do it myself. I think I can figure it out. I'll post it when I'm done so you can check it

---PARANOID PRODUCTIONS---
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th May 2007 03:37 Edited at: 24th May 2007 03:37
No problem, it doesn't bug me to help people . You mean like this:



Don't hesitate to ask more questions on how things work or how to do things, it's the best way to learn .

EDIT: Oh, you posted while I was posted, well just try it yourself if you want then check it with mine .


Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:39 Edited at: 24th May 2007 03:40
You're very helpful, and I really appreciate it! Thanks for all of this! I'm really starting to understand arrays and DIM and such commands! Before I now I tried doing this:



Lol. It never worked, and it always printed ALL of the IF messages. Ugh! Anyways, you've been a big help! Thanks a ton!

[Edit] Yeah, I tried my edited version and it gave me an error lol [/edit]

---PARANOID PRODUCTIONS---
Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:44
I've found a slight bug. After a certain period, if you type the trigger words it still sends randomResponse. Try it! Type random gibberish for a while then try the normal triggers.

---PARANOID PRODUCTIONS---
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th May 2007 03:49
no problem . As for the bug, I tried it and it works fine for me, are you sure you didn't just type something wrong?


Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 03:52 Edited at: 24th May 2007 03:54
Type gibberish non-stop for maybe 30 seconds. Like this:

sgshs
sghsghjns
hajy
dhyhg
ggg
hjd6


etc etc..

just keep doing that for a while then try normal speech.

[Edit] Gah! I found out that sometimes DBP must screw up because this time it gave one of the normal responses nonstop. Ahh well, just dont type too fast. [/edit]

---PARANOID PRODUCTIONS---
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 24th May 2007 05:06
No... DBP is definitely not the one screwing up here >.>

You probably just hit enter twice sending a null string, causing it to give you the weird response. That or you typed the phrase incorrectly.

Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 24th May 2007 23:03
What about (possibly) learning? Like a learning robot. If he says something the user says is wrong, the user can say something like "@wrong [corrected sentence here]"

Is this possible?

---PARANOID PRODUCTIONS---
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th May 2007 01:07
The best thing to do is have your bot search for key words in whatever you send it, and depending on which keywords are found, you'd display a certain response. This way you dont have to enter the exact phrase to have the bot respond.

Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 25th May 2007 01:29
That's a good idea. Wish me luck in doing something I have NO idea of how to do.

---PARANOID PRODUCTIONS---

Login to post a reply

Server time is: 2024-11-25 17:58:06
Your offset time is: 2024-11-25 17:58:06