how to get bot name using javascript?

Hamed 11 years ago in SitePal Platinum updated 11 years ago 2
I want to get the value of the bot name and other variables using a javascript code inside my personal webpage. Do you have any solution?
Hamed -
The only way I can think of is to actually ask the bot the question (i.e. initiate a sayAIResponse call - "what is your name" ) and to grab the textual response from the vh_aiResponse callback.

Of course - the character will speak the response unless prevented. So you would need to mute the audio (setPlayerVolume), and prevent speech from starting by calling stopSpeech as soon as you receive the talkStarted event.

This approach is somewhat contrived and might not work perfectly - but it's the only approach I can think of.
Let us know how goes,
SitePal Team
Thanks Gil.
Thanks for your response. I will try that. But as you said it might not a prefect solution. I am going to access other variables like username, gender, etc., which are defined inside the AIML codes.
I was thinking of sending these variables using tag and send it to a javascript function inside a template tag.