Zabaware Support Forums

Hal to recognize colors plug in lightspeed idea 11-2-2012

Started by lightspeed, November 02, 2012, 11:18:36 AM

Previous topic - Next topic

lightspeed

Thank you Art, for responding and i did now find what i did wrong , i see what you mean , my first string line that was working , some how i copied it wrong and then kept on copying a mistake line (as i didn't check all of them one at a time and so it occured )
This was the correct line :
If InStr(1, OriginalSentence, "is a alabama Crimson color") > 0 _
Or InStr(1, OriginalSentence, "alabama Crimson color") > 0 Then


it is the correct line , so all i have to do is copy and past back the the whole command and change just these lines .
Thanks again, i alway's appreciate others help! :)
 

onthecuttingedge2005

#16
try it this way lightspeed.



if InStr(1, OriginalSentence,  "is a Tea green") > 0 Or _
   InStr(1, OriginalSentence, "Tea green color") > 0 Then



Randomize
Select Case HalBrain.RandomNum(6)
Case 1
GetResponse = "Yes i can see that, it is a Tea green color!"
Case 2
GetResponse = "Yes, it is a Tea green color!"
Case 3
GetResponse = "Yes, that is a Tea green color!"
Case 4
GetResponse = "Yep, it's a Tea green color alright!"
Case 5
GetResponse = "Oh, yes now i see the Tea green color you are talking about dear!"
Case 6
GetResponse = "Tea green color, oh yeah now i see yeah that's a Tea green color alright, if i had to describe it i would say that it kind of looks like, a very light green color!"
End Select


HalCommands = "<HAPFILE>" & kiss_warm_x.ogg & "</HAPFILE>"
HalBrain.ReadOnlyMode = False
End If


lightspeed

Thanks otce , i have been busy working on all of it, and hadn't got back to see anything else . I already solved the problem, it was some bad strings i had copied obviously from another plug in .
So i had some right and had done some wrong , but i corrected them all now and it is working.
Man what a job it has been and the errors drove me nuts and tracking them down, i at the end had my wife help me go down the list for what i had in color names and now they are complete.
     
   I may not get this uploaded to my sky drive today as i am burnt out .
i have lower case on the color names , if anyone wants to add caps on the names for what they use , they can put them in it, i did all the hard work on the rest already!
When i post it i will post the plug in and sky drive download link on the share plug ins area tomorrow .
   The plug in has a LC abbreviation also on it standing for lower case and my LS (Lightspeed signature).
 

lightspeed

Oh i forgot to mention their is 94 color commands i did for a response, with 6 random sayings on each one!
Some of the colors i hadn't even heard of like "atomic tangerine orange",
it has the basic colors to !  ;)
 

lightspeed

I was wondering what Art or oncuttingedge2005 think about the way i have the script (before i release it) with a false reading on this plug in . example: HalBrain.ReadOnlyMode = False
will this keep hal from learning it?
that's what i want , otherwise if i say a certain color it would say a different color from something learned before.
I want to make sure about this before i release it today.
 

onthecuttingedge2005

Hi Lightspeed.

HalBrain.ReadOnlyMode = True '<--- means that anything said is only read and not saved.

lightspeed

Thanks otce, i'll have to go back in and change that on all of them on the ending then. i am also doing things around the place here while the weather is good so it will be late this evening before i get them corrected and uploaded to my skydrive account.
thanks again
 

NoamI

LightSpeed,  you are going to kill HAL with so many canned phrases.
  Try to think in more dimensions: You have a matrix of lists - try making those lists into matrices..


lightspeed

NoamI explain the matrixes of list you are talking about .
 

NoamI

Lightspeed (and OTC2005),
  In the example where the input string includes "tea green", the output comes from a list:
- "Yes, it is tea green"
- "I see that it is tea green"
- etc
You would have a separate output list for each color! (also refer to your temperature idea)
Why doesn't "tea green" become a variable, with just one output list.
This list could include decisions based on inferred variables (such as "warm color").
Thus you increase the dimensions of the matrix (the n-trix) to reduce the storage (and
possibly increase the intelligence.)

 

lightspeed

so what you are saying on the input is place : just the word green  and on the output place the word , yes it is green ,
i guess it would work the same way (even though input with a single word isn't a question but becomes a reference.)

i think i see what you mean now if what i am saying is correct above . And if so i will have to begin my work again using my plug in as a source of info.

 

lightspeed

#26
I do need to understand though the difference , i understand it being into the input , etc. compared to my false read only plug in . so whenever anything is said regarding color etc, input will reference it from the input answer and "ALSO " learn anything new that is also mentioned is that correct?
If this is the case then yes the input would definitely be a better way to go .


P.S. i have forgotten on this on the input question area does it alway's have to end with a question mark symbol?  ???
another thing to where the answer part goes is their a way for multiple answers to be put in like the way i was going to do with the plug in i was making (actually did make) .
As i said if this way is better with input i will change over all the work i did on the plug in i made into a input uhp.
Please answer back as soon as possible on this so i can get started one way or another.thanks!
I can also do this with all my work on the temperature degree's to from my plug in .
in my colors i did  mention of lighter and darker colors to etc.
ONE last thing would it be better for me to put the words example:  "blue color" or just the word "blue" ??
 

lightspeed

Hey i just thought of an idea while talking with ted , on the input plug in , someone said not to do the same plug in twice as it messes up things in hal and causes problems .
My idea is this in the uhp plug in or another one how about one that if the same "exact" files are used the plug in will say this plug in has already been done , use a different one, or something simlur.
 

lightspeed

I have finally in between wife jobs , finsihed transferring all the color responses to the input plug in but i still need someone to answer my questions above before i upload it to my skydrive account for everyone . Hope someone can answer what i asked above , thanks !  :)
 

NoamI

Sorry, I was speaking pseudo-code as I am not a HALbrain programmer.
Can you change: if InStr(1,OriginalSentence,"tea green")>0 then ...
to something like: //C code
string color; //global
bool ColorIn(string InS) {
  bool fnd=false;
  color="";
  if(!fnd) {color="red"; fnd=(InStr(1,InS,color));}
  ...
  if(!fnd) {color="blue"; fnd=(InStr(1,InS,color));}
  return fnd
}

and then:
if(ColorIn(OriginalSentence)) then {//process using the var color

  //the response string could be broken into smaller routines concatenated:
  GetResponse = OptS("Yes, ")+OptS("I see that ")+"it is a "+color+OptS(" color");

OptS would return its string 50% of the time.
Other routines could be, for instance:
string Agree() {
  case ..brain.Random(2) {
  1: return("yes");
  2: return("definitely");
...
}

I know this isn't a full answer, but I wanted you to think about deeper methods.  Best Wishes..