Created
December 26, 2008 13:37
-
-
Save pbuyle/40065 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "tux-say", | |
icon: "http://tuxisalive.com/favicon.ico", | |
homepage: "http://www.tuxisalive.com/tux-droid-forum/scripts/673765359", | |
author: { name: "mongolito404", email: "[email protected]"}, | |
license: "GPL", | |
description: "Read a text with your Tux Droid.", | |
help: "tux-say Hello World", | |
takes: {"input": noun_arb_text}, | |
execute: function(msg) { | |
jQuery.get('http://127.0.0.1:270/0/tts/speak?text='+msg.text); | |
} | |
}); | |
//Noun yype for Loccutors... | |
var noun_type_locutor = { | |
_name: 'Locutor', | |
_locutors: [], | |
suggest: function(text, html) { | |
var suggestions = []; | |
if (typeof text != "string") { | |
// Input undefined or not a string | |
return []; | |
} | |
for ( var x in this._locutors ) { | |
var word = this._locutors[x].toLowerCase(); | |
if ( word.indexOf( text.toLowerCase() ) > -1 ) { | |
suggestions.push( CmdUtils.makeSugg(this._locutors[x]) ); | |
} | |
} | |
return suggestions; | |
} | |
}; | |
//Get available locutors | |
jQuery.get('http://127.0.0.1:270/0/tts/voices?', {},function(data){ | |
noun_type_locutor._locutors = jQuery.map(jQuery(data).find("locutor"), function(locutor){ | |
locutor = jQuery(locutor); | |
return locutor.text().replace('8k',''); | |
}); | |
}); | |
CmdUtils.CreateCommand({ | |
name: "tux-set-locutor", | |
icon: "http://tuxisalive.com/favicon.ico", | |
homepage: "http://www.tuxisalive.com/tux-droid-forum/scripts/673765359", | |
author: { name: "mongolito404", email: "[email protected]"}, | |
license: "GPL", | |
description: "Set the <i>locutor</i> for your Tux Droid.", | |
takes: {"locutor": noun_type_locutor}, | |
execute: function(input) { | |
jQuery.get('http://127.0.0.1:270/0/tts/locutor', {name: input.text}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment