SiriProxy icon indicating copy to clipboard operation
SiriProxy copied to clipboard

Plugin's

Open laxman01 opened this issue 13 years ago • 14 comments

http://pastebin.com/6dZxAvCH

could someone please check this plugin for me

thank you

laxman01 avatar Jan 23 '13 21:01 laxman01

Is it not hosted anywhere as a repo?

Deanmv avatar Jan 23 '13 22:01 Deanmv

no i have it all on my computer i just uploaded the code to this site

laxman01 avatar Jan 23 '13 22:01 laxman01

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 :)

Raggyx avatar Jan 23 '13 23:01 Raggyx

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

laxman01 avatar Jan 23 '13 23:01 laxman01

listen_for /quiz/i do response = ask "Question" if response.strip == "Answer" #do something 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'

Raggyx avatar Jan 23 '13 23:01 Raggyx

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

laxman01 avatar Jan 23 '13 23:01 laxman01

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"

laxman01 avatar Jan 23 '13 23:01 laxman01

This is currently where i'm at.

laxman01 avatar Jan 23 '13 23:01 laxman01

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"

laxman01 avatar Jan 24 '13 01:01 laxman01

/Users/Laxgoalie1996/Desktop/SiriProxy/plugins/siriproxy-computer/lib/siriproxy-computer.rb:569: syntax error, unexpected $end, expecting keyword_end (SyntaxError)

new error

laxman01 avatar Jan 24 '13 02:01 laxman01

Please someone help me

laxman01 avatar Jan 24 '13 02:01 laxman01

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

Raggyx avatar Jan 24 '13 06:01 Raggyx

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

Deanmv avatar Jan 24 '13 10:01 Deanmv

Thank you so much for all of your help

laxman01 avatar Jan 24 '13 20:01 laxman01