There are are couple of problems with that, like
Code: Select all
[TEXTSCAN]
Measure=String
String=[MeterSetVariable]
A meter has no "value". You can't set the value of a String measure to the "value" of a String meter. You can only use the value of a measure in a [SectionVariable].
But to be honest, this whole thing has a fatal flaw. The problem is that IfMatch does not support any kind of "if / then / elseif / else" construct. Each IfMatch option is a standalone question that can only ask "is this true?" and set one of either "it is", or "it isn't". Presumably you want some IfNotMatch action, like "I didn't understand". So if the first IfMatch is "true", it will set the IfMatchAction. If then the second IfMatch is "false", and of course it will be, that one will set the IfNotMatch action of "I didn't understand".
There is no easy way to say "If I said this, do that, if I said this do that, if I said this, do that. If I said none of those, do something else."
So aside from the
boatload of IfMatch[N] actions you would need to flesh this out, it's going to be difficult to get graceful behavior.
I'd recommend doing this in Lua where you can in fact have "if / then / elseif / else" thinking, and simply have a table of your "input snippets" like "hi", that return the response, like "Hi there, nice to see you again". If no match is made on the table, you return "I didn't understand".
Getting the "AI" right is going to be a challenge, you are going to to want to for example search on "hi " and not "hi", so you you don't have it respond to "Hitler was a great guy, and I really miss him" with "Hi, nice to see you". Even the most basic AI, much less something like Google Now or Cortana, attempt to get the "sense" of the input, which is not just based on keywords, but complicated weighting and the order of words in a sentence, and who knows what else.
You might want a different response to "Hi there, nice to meet you", than you do to "Hi little girl, how about some free candy in my van?" If you don't, then your trip to insanity is pretty much complete isn't it...
But having said that, here is something that is loosely based on what you had, that at least "works".
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
FontSize=14
[MeterBackground]
Meter=Image
SolidColor=008fb3
W=250
H=105
[MeterPrompt]
Meter=String
X=5
Y=60
FontSize=15
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Text=Speak to P.U.N.
LeftMouseUpAction=[!SetOption RESPONDINGTEXT Text "I'm listening"][!UpdateMeter RESPONDINGTEXT][!Redraw][!CommandMeasure "MeasureInput" "ExecuteBatch 1"]
[MeasureInput]
Measure=Plugin
Plugin=InputText
SolidColor=76A0E8FF
FontColor=255,255,255,255
FontFace=Seqoe UI
StringStyle=Italic
FontSize=#FontSize#
X=5
Y=60
H=25
W=240
OnDismissAction=[!SetOption RESPONDINGTEXT Text "Welcome"][!UpdateMeter RESPONDINTEXT][!Redraw]
Command1=[!SetOption TEXTSCAN String "$UserInput$"][!EnableMeasure TEXTSCAN][!UpdateMeasure TEXTSCAN][!UpdateMeter RESPONDINGTEXT][!Redraw]
[RESPONDINGTEXT]
Meter = string
FontSize=15
X=5
Y=5
W=240
ClipString=1
FontColor=230,250,155
TEXT=Welcome
[TEXTSCAN]
Measure=String
IfMatch=(?i)hi
IfMatchAction=[!SetOption RESPONDINGTEXT Text "Hi, nice to see you"]
IfNotMatchAction=[!SetOption RESPONDINGTEXT Text "I didn't understand"]
Disabled=1
UpdateDivider=-1
DynamicVariables=1
GIF.gif
You do not have the required permissions to view the files attached to this post.