Asked — Edited

Snybot Plugin Question

I tried loading the SynBot plugin following the tutorial and the plugin just comes up as a white box. I tried loading it into a clean new project and got the same results. I am using window 10 32bit laptop, ARC version 2018.01.15.00

My guess is the plugin needs to be updated.

any suggestions?


ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

#9  

And for first question only Classic to day i just look to the opportunity to migrate to oscova modern version

PRO
USA
#10  

Jlucben, Here is a routine I came up with. It watches for change in the $SynbotTextResponse variable and then checks if the Learned.siml file exists (UnasLearned.siml) in mycase and then takes the learned data from that file and writes it to another file NewData.siml. This way the learned siml data is not lost at restart. I have created a few simple siml files for. BlankCanBlank, BlankHaveBlank, BlankCanNotBlank... Here is the code for one of the siml file BlankCanBlank


<Siml xmlns:x="http://syn.co.in/2014/siml#external" xmlns:Think="http://syn.co.in/2014/siml#think">
  <Concept Name="BlankCanBlank" Type="Public">
     <Model>
      <Pattern>* can *</Pattern>
      <Response>
         <Learn>
          <Model>
            <Pattern>Can <Process xml:space="preserve"><Match /> <Match 
               Index="2" /></Process></Pattern>
            <Response>Yes, <Process><Match Index="1" /> can <Match Index="2" />
           </Process></Response>
          </Model>
	   </Learn>         
         Ok, I now know that <Match /> can <Match Index="2" /></Response>
    </Model>
 </Concept>
</Siml>

And here is the Learned file data I capture and copy to the NewData file


<Model>
      <Pattern>Can ducks swim</Pattern>
      <Response>Yes, ducks can swim</Response>
    </Model>
    <Model>
      <Pattern>Can dogs swim</Pattern>
      <Response>Yes, dogs can swim</Response>
    </Model>
    <Model>
      <Pattern>Can birds fly</Pattern>
      <Response>Yes, birds can fly</Response>
    </Model>
    <Model>
      <Pattern>Can birds sing</Pattern>
      <Response>Yes, birds can sing</Response>
    </Model>

So the pattern and the response is created by the <learn>

Here is the EZ-Script that does the copy and then deletes the Learned file.


:LearnedData
WaitForChange($SynbotTextResponse)

DefineArray($SourceArray,1)
DefineArray($DestArray,1)
$SourceFile = &quot;c:/users/richard/unas/synbot/UnasLearned.siml&quot;
$DestFile = &quot;c:/users/richard/unas/synbot/unas/NewData.siml&quot;
FileReadReset($SourceFile)
FileReadReset($DestFile)
if(fileExists($SourceFile) = true)
  :FileLoop
  if(FileReadEnd($SourceFile) = false)
    AppendArray($SourceArray,FileReadLine($SourceFile))
    Goto(FileLoop)
  endif
  #Filter out the rainbows and buttercups
  if(Contains($SourceArray[5], &quot;XXXXX&quot;))
  FileReadReset($SourceFile)
   goto(End)
 endif
  :FileLoop2
  if(FileReadEnd($DestFile) = false)
    AppendArray($DestArray, FileReadLine($DestFile))
    Goto(FileLoop2)
  endif
  $DArrayLength = GetArraySize(&quot;$DestArray&quot;)
  $SArrayLength = GetArraySize(&quot;$SourceArray&quot;)
  $DestArray[$DArrayLength - 2] = $SourceArray[4]
  $DestArray[$DArrayLength - 1] = $SourceArray[5]
 # $DestArray[$DArrayLength - 1] = $SourceArray[6]
  AppendArray($DestArray, $SourceArray[6])
  AppendArray($DestArray, $SourceArray[7])
  AppendArray($DestArray, $SourceArray[8])
  AppendArray($DestArray, $SourceArray[9])
  $DestArray[2] = &quot;&lt;Concept Name=&quot; + GetAsByte(34) + &quot;NewData&quot; + GetAsByte(34) + &quot; Type=&quot; + GetAsByte(34) + &quot;Public&quot; + GetAsByte(34) + &quot; repeat=&quot; + GetAsByte(34) + &quot;true&quot; + GetAsByte(34) + &quot;&gt;&quot;
 if($SArrayLength &gt; 10)
  AppendArray($DestArray, $SourceArray[10])
  AppendArray($DestArray, $SourceArray[11])
  AppendArray($DestArray, $SourceArray[12])
  AppendArray($DestArray, $SourceArray[13])
 endif
  FileReadReset($SourceFile)
 FileReadReset($DestFile)
 
  FileDelete($SourceFile)
  FileDelete($DestFile)
  
  $DArrayLength = GetArraySize(&quot;$DestArray&quot;)
  $Counter = 1
  :DestLoop
  repeatwhile($Counter &lt; $DArrayLength)
  FileWriteLine($DestFile, $DestArray[$Counter])
  $Counter = $Counter + 1
  Goto(DestLoop)
  endrepeatwhile
  endif
  :End
  $SayWhat = $SynbotTextResponse
  goto(LearnedData)

PRO
USA
#11  

Rewrite of the EZ-Script This now allows for any size Learned.siml source file. I needed the rewrite so as to support having random and multiple responses learned.

Here is an example of a multiple response learn That creates: Where is * located And Is * located in *


&lt;Siml xmlns:x=&quot;http://syn.co.in/2014/siml#external&quot; xmlns:Think=&quot;http://syn.co.in/2014/siml#think&quot;&gt;
  &lt;Concept Name=&quot;BlankIsLocatedInBlank&quot; Type=&quot;Public&quot;&gt;
     &lt;Model&gt;
      &lt;Pattern&gt;* is located in *&lt;/Pattern&gt;
      &lt;Response&gt;
         &lt;Learn&gt;
          &lt;Model&gt;
            &lt;Pattern&gt;Where is &lt;Process xml:space=&quot;preserve&quot;&gt;&lt;Match /&gt; located &lt;/Process&gt;&lt;/Pattern&gt;
            &lt;Response&gt;&lt;Process&gt;&lt;Match Index=&quot;1&quot; /&gt; is located in &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Response&gt;
          &lt;/Model&gt;
		&lt;Model&gt;
            &lt;Pattern&gt;is &lt;Process xml:space=&quot;preserve&quot;&gt;&lt;Match /&gt; located in &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Pattern&gt;
            &lt;Response&gt;&lt;Process&gt;Yes, &lt;Match Index=&quot;1&quot; /&gt; is located in &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Response&gt;
          &lt;/Model&gt;
          &lt;/Learn&gt;         
         Ok, I now know that &lt;Match /&gt; is located in &lt;Match Index=&quot;2&quot; /&gt;&lt;/Response&gt;
    &lt;/Model&gt;
  &lt;/Concept&gt;
&lt;/Siml&gt;

And the Random looks like this:


Siml xmlns:x=&quot;http://syn.co.in/2014/siml#external&quot; xmlns:Think=&quot;http://syn.co.in/2014/siml#think&quot;&gt;
  &lt;Concept Name=&quot;BlankCanBlank&quot; Type=&quot;Public&quot;&gt;
     &lt;Model&gt;
      &lt;Pattern&gt;* can *&lt;/Pattern&gt;
      &lt;Response&gt;
         &lt;Learn&gt;
          &lt;Model&gt;
            &lt;Pattern&gt;Can &lt;Process xml:space=&quot;preserve&quot;&gt;&lt;Match /&gt; &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Pattern&gt;
            &lt;Response&gt;&lt;Random&gt;
			&lt;Item&gt;Yes, &lt;Process&gt;&lt;Match Index=&quot;1&quot; /&gt; can &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Item&gt;
			&lt;Item&gt;That is correct, &lt;Process&gt;&lt;Match Index=&quot;1&quot; /&gt; can &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Item&gt;
			&lt;Item&gt;You got it, &lt;Process&gt;&lt;Match Index=&quot;1&quot; /&gt; can &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Item&gt;
			&lt;Item&gt;With out a dought, &lt;Process&gt;&lt;Match Index=&quot;1&quot; /&gt; can &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Item&gt;
			&lt;Item&gt;For sure, &lt;Process&gt;&lt;Match Index=&quot;1&quot; /&gt; can &lt;Match Index=&quot;2&quot; /&gt;&lt;/Process&gt;&lt;/Item&gt;
			&lt;/Random&gt;
&lt;/Response&gt;
          &lt;/Model&gt;
	   &lt;/Learn&gt;         
         Ok, I now know that &lt;Match /&gt; can &lt;Match Index=&quot;2&quot; /&gt;&lt;/Response&gt;
    &lt;/Model&gt;
      &lt;/Concept&gt;
&lt;/Siml&gt;

Here is the updated EZ-Script.


:LearnedData1
#WaitForChange($SynbotTextResponse)
DefineArray($SourceArray,1)
DefineArray($DestArray,1)
$SourceFile = &quot;c:/users/richard/unas/synbot/UnasLearned.siml&quot;
$DestFile = &quot;c:/users/richard/unas/synbot/unas/NewData.siml&quot;
FileReadReset($SourceFile)
FileReadReset($DestFile)
if(fileExists($SourceFile) = true)
:ReadSource
 if(FileReadEnd($SourceFile) = false)
   $SourceData = FileReadLine($SourceFile)
   if(Contains($SourceData, &quot;XXXXX&quot;))
   FileReadClose($SourceFile)
     goto(TheEnd)
   endif
    AppendArray($SourceArray,$SourceData)
    Goto(ReadSource)
    FileReadReset($SourceFile)
  endif
  :ReadDestination
  if(FileReadEnd($DestFile) = false)
    AppendArray($DestArray, FileReadLine($DestFile))
    Goto(ReadDestination)
  endif
  $DArrayLength = GetArraySize(&quot;$DestArray&quot;)
  $SArrayLength = GetArraySize(&quot;$SourceArray&quot;)
  $DestArray[$DArrayLength - 2] = $SourceArray[4]
  $DestArray[$DArrayLength - 1] = $SourceArray[5]
  $LineCount = 6
  repeatwhile($LineCount &lt; $SArrayLength)
  AppendArray($DestArray, $SourceArray[$LineCount])
  $LineCount = $LineCount + 1
  endrepeatwhile
  $DestArray[2] = &quot;&lt;Concept Name=&quot; + GetAsByte(34) + &quot;NewData&quot; + GetAsByte(34) + &quot; Type=&quot; + GetAsByte(34) + &quot;Public&quot; + GetAsByte(34) + &quot; repeat=&quot; + GetAsByte(34) + &quot;true&quot; + GetAsByte(34) + &quot;&gt;&quot;
    
  FileReadclose($SourceFile)
  FileReadClose($DestFile)
  FileDelete($SourceFile)
  FileDelete($DestFile)
  
  $DArrayLength = GetArraySize(&quot;$DestArray&quot;)
  $Counter = 1
  :DestLoop
  repeatwhile($Counter &lt; $DArrayLength)
  FileWriteLine($DestFile, $DestArray[$Counter])
  $Counter = $Counter + 1
  Goto(DestLoop)
  endrepeatwhile
endif
:TheEnd
  $SayWhat = $SynbotTextResponse
  goto(LearnedData1)
Halt()

It works slick.

#12  

Hi

I will correct the plugin in order to append the learned models in the learned.siml file, when a new model is learned.

But your code is working fine ......

PRO
USA
#13  

I still have a lot to learn about SIML, but I love the plugin. Great job. I will let you know of anything else I find before I write code to work around it.

#14  

Thanks

I have a developper licence for Synbot and have easiercontacts with the indian company. So don't hesitate to contact me in case of problems or questions before coding.

I will publish a new version as soon as possible with ability to integrate easilly personnal Adaptators for new SIML tags Coded in C# and a Bot learning framework using User Variables and Maps.

New version with update Learn.SIML in Append mode will be soon.

PRO
USA
#15  

Syntax for the exponent function

I tried <Match />e<Match Index ="2" />

where both match = 2 and I get an answer of 200

If I try <Match />e(<Match Index ="2" />) I get nothing

PRO
USA
#16  

couldn't find anything on it so I used JavaScript:


&lt;Model&gt;
		&lt;Pattern&gt;what is * to the power of *&lt;/Pattern&gt;
		&lt;Response&gt;The answer is &lt;Js&gt;function powr(num1, num2){
		return Math.pow(num1, num2);
		}
		powr(&lt;Match /&gt;, &lt;Match Index=&quot;2&quot; /&gt;);
		&lt;/Js&gt;
		&lt;/Response&gt;
&lt;/Model&gt;