Hello I have another problem with AIML, i need to start browser but the aiml is starting they say starting google after I say launch browser and nothing is open. I try on many ways, and past few days of writening i can't do the correct code.
Here is the sample code of aiml:
 

<?xml version="1.0" encoding="UTF-8"?>

<aiml>
<category><pattern>LAUNCH BROWSER</pattern>
<template>Starting google  <oob><url>https://www.google.com</url></oob></template&gt;
</category>
</aiml>

Is there posibility to launch url from aiml, and how to do it?

With the orginal code of alice is these same problem, not work.

I want to write aiml that will be play internet radio or other music from url.
My browser is not responding to this code, I have no errors.

Kakadu31

8 years 1 month ago

Hi, if the standart aiml is not doing what you want you can write ython script in the code to do it here is an example using barebonesbrowserlaunch so exactly what could fit your purpose ;)
 

<category>
<pattern>SHOW ME *</pattern>
    <template>Here is an image of:
     <oob>
        <mrl>
            <service>python</service>
            <method>exec</method>
            <param>
from org.myrobotlab.net import BareBonesBrowserLaunch
imageFrom = "<star/>"
respo = robe.getResponse("show me HELPFUNCTION <star/>")
respoText = robe.publishResponseText(respo)
startIndex = robe.publishResponseText(respo).index("href")
endIndex = robe.publishResponseText(respo).index(">")
link = respoText[(startIndex+6):(endIndex-1)]
BareBonesBrowserLaunch.openURL(link)
        </param>
        </mrl>
     </oob>
    </template>
  </category>

bartcam

8 years 1 month ago

Thank You for helping me.
Here is the simplest way of Your template to open browser:
 


<category>
<pattern>SHOW ME *</pattern>
    <template>Loading site <star/>:
     <oob>
        <mrl>
            <service>python</service>
            <method>exec</method>
            <param>
from org.myrobotlab.net import BareBonesBrowserLaunch
BareBonesBrowserLaunch.openURL("http://www.<star/>.com&quot;)
        </param>
        </mrl>
     </oob>
    </template>
  </category>
Best Regards

 

Kakadu31

8 years 1 month ago

In reply to by bartcam

Yeah nice done!

Mine was a bit more complex but it is meant to extract the link of the response from programmab's image search, but it is broken at the moment ;/