In the python script for my robot, I'm searching for a way to detect a variable change. After doing a search, I found this example in VB.NET.
http://www.daniweb.com/forums/post610941.html#post610941
I've tried to translate it into a python bit, but with no success.
What I want my robot to do is this:
When talking to the robot, the robot ought to detect a change in topic. For instance, if I talk to my robot about, say Dinosaurs, and all of the sudden I say a string that has to do with another topic, have the robot say something like, "That's cool, but aren't we talking about Dinosaurs?"
Like so in this psuedo code:
class Topic:
OnTopic = 'Dinosaurs'
if OnTopic changes #Or tries to change? This is the main part I'm stumped on
GetVariable(OnTopic)
speaker.Speak('Thats cool, but arent we talking about', OnTopic)
if "yes we are"
speaker.Speak('Okay')
Set OnTopic to 'Dinorsaurs'
elif "No, now we're talking about movies"
speaker.Speak('Okay, lets talk about movies')
Set OnTopic to 'movies'
I'll continue to search for a solution myself. Thanks.