Skip to content

Instantly share code, notes, and snippets.

@floere
Created May 13, 2011 08:57
Show Gist options
  • Save floere/970226 to your computer and use it in GitHub Desktop.
Save floere/970226 to your computer and use it in GitHub Desktop.
Simple example dialogue for James.
require 'rubygems'
require 'james'
# This is a very simple James example for MacRuby.
#
# James is a voice controlled butler:
# http://github.com/floere/james
#
# Run using:
# 1. gem install james
# 2. macruby james_very_simple_example.rb
#
James.dialogue do
hear 'What time is it?' => :time
state :time do
hear ['What time is it?', 'What time is it now?'] => :time
into do
time = Time.now
"It is currently #{time.hour} #{time.min}."
end
end
end
James.listen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment