Why this bot no worky? (Been away again)

I have tried to run this chatbot on Windows with Chrome (no inMoov connected). I duplicated the Alice2 bot file and called it "ghostchat". When run this in MRL it opened webgui but threw an error. I modified nothing in the swinggui. Should I have? Everything looks different in there to what it used to when I last used it. Webgui says  error   runtime : createAndStart(null, null) error.

When it opens the Webgui has an empty box and no services started. I don't know what I'm supposed to be adding in there also, if anything. 

Can anyone see what I'm doing wrong here?  I'm sure there are many things. Is that the correct syntax for NaturalReaderSpeech. I'm not starting any services at all before running this. 

###############################

from org.myrobotlab.service import Runtime

from java.lang import String

Ghost = Runtime.createAndStart("Ghost", "WebGui")

wksr = Runtime.createAndStart("webkitspeechrecognition", "WebkitSpeechRecognition")

ghostchat = Runtime.createAndStart("ghostchat", "ProgramAB")

ghostchat.startSession("ProgramAB/bots", "ghostchat")

htmlfilter = Runtime.createAndStart("htmlfilter", "HtmlFilter")

NaturalReaderSpeech = Runtime.createAndStart("speech", "NaturalReaderSpeech")

voices = NaturalReaderSpeech.getVoices()

for voice in voices:  //I've also tried removing this because I got an iteration error for this line

          NaturalReaderSpeech.setVoice("Ryan")

wksr.addTextListener(ghostchat)

ghostchat.addTextListener(htmlfilter)

htmlfilter.addTextListener(NaturalReaderSpeech)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
GroG's picture

Ahoy Humanoid ! Welcome back

Ahoy Humanoid !

Welcome back ...  I'll check what I get from the "latest"

GroG's picture

Polished the script a bit -

Polished the script a bit - you can uncomment the for voices loop if you use the latest build, but its not necessary for what you want to do ... it just prints out the voices ..

Actually it just sets the current voice to Ryan 16 times ... so leave it commented out .. its silly

 

Here's the script - https://github.com/MyRobotLab/pyrobotlab/blob/master/home/Humanoid/ghost.py

[[/home/Humanoid/ghost.py]]

Humanoid's picture

Progress thx to Cap'n Grog

Your fixing-up of my dud script worked a treat on the Mac when I changed to alice2 bot. 

Confirmed bung mic on the Win10 laptop so now problem sorted.

Clearly I've done something wrong with my ghostchat bot as well and now need to figure this out. 

Thx, Grog! 

kwatters's picture

aiml directory not found perhaps?

maybe your script is expecting the aiml files in the wrong place.  you should look in the log files, when you start the session, it will log where it's looking for the aiml for your chat bot.

if there's a malformed aiml file, that might also cause a problem.  these errors will also show up in the myrobotlab.log file.

AutonomicPerfectionist's picture

WebGui Problem

I'm not sure, but it could be a problem with the latest WebGui. It looks like it's been refactored again, and may not communicate correctly with the browser anymore. That doesn't explain the createAndStart(null, null) error you described though... I'll take a look tomorrow and see if I can reproduce the problem. It seems like a bunch of errors were caused recently relating to WebGui, so that might be where your problem is coming from.

Humanoid's picture

Very kind. Thx.

Thanks for that. Much appreciated.

I really need to figure out how to create a chat-bot properly in ProgramAB. I'd say for me currently it's a case of PIBCAK (Problem In Between Chair And Keyboard) or PICNIC (Problem In Chair, Not In Computer).

Oh the Lulz.