Closed laxman01 closed 11 years ago
Is it not hosted anywhere as a repo?
no i have it all on my computer i just uploaded the code to this site
have you seen the example plugin? regarding on how to ask a question in a siriproxy plugin
https://github.com/plamoni/SiriProxy/tree/master/plugins/siriproxy-example
btw every listen_for /.../i do
has to be closed by an end
and the if
statements too :)
yes i have seen the example plugin but i did not see on how to ask questions on it and thank you for your help with that
listen_for /quiz/i do
response = ask "Question"
if response.strip == "Answer"
end end
use "say" to say something an use "ask" like i did to ask something
edit: see from line 65 in the file 'siriproxy-example.rb'
What im trying to set up is something like flashcards.. where i would say quiz me then it would ask me a series of programed in questions for whatever class, then after the question has been asked and i have answered it myself i will say "answer" then siri will tell me the correct answer then i will say "next" and it will repeat this process with all the other questions
listen_for /Quiz Me In (.*)/i do |userAction| userAction.strip! if userAction == "Bio" or userAction == "Biology" or userAction == "Science" then Say"Question" answer = listen_for /Answer/i do end answer.strip! if answer == "Answer" say "Answer" question = listen_for /Next/i do end question.strip! if question == "Next" say "Question"
This is currently where i'm at.
listen_for /Quiz Me In (.*)/i do |userAction| userAction.strip! if userAction == "Bio" or userAction == "Biology" or userAction == "Science" then question == ask "Question" question.strip! if question == "Answer" or question == "Show me the Answer" then say "Answer" request_completed end
the error im getting is this
syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' (SyntaxError) question == ask "Question"
/Users/Laxgoalie1996/Desktop/SiriProxy/plugins/siriproxy-computer/lib/siriproxy-computer.rb:569: syntax error, unexpected $end, expecting keyword_end (SyntaxError)
new error
Please someone help me
question == ask "Question" is a comparison but should be an allocation and dont forget to complete every if statement with "end" the if statements dont have the keyword 'then' Its very difficult to set up a good program without having basic programming knowledge
for
listen_for /Quiz Me In (.*)/i do |userAction|
userAction.strip!
if userAction == "Bio" or userAction == "Biology" or userAction == "Science" then
question == ask "Question"
question.strip!
if question == "Answer" or question == "Show me the Answer" then
say "Answer"
request_completed
end
You would need either
listen_for /Quiz Me In (.*)/i do |userAction|
userAction.strip!
if userAction == "Bio" or userAction == "Biology" or userAction == "Science" then
question = ask "Question"
question.strip!
end
if question == "Answer" or question == "Show me the Answer" then
say "Answer"
request_completed
end
end
Thank you so much for all of your help
http://pastebin.com/6dZxAvCH
could someone please check this plugin for me
thank you