plamoni / SiriProxy

A (tampering) proxy server for Apple's Siri
GNU General Public License v3.0
2.12k stars 343 forks source link

Plugin's #413

Closed laxman01 closed 11 years ago

laxman01 commented 11 years ago

http://pastebin.com/6dZxAvCH

could someone please check this plugin for me

thank you

Deanmv commented 11 years ago

Is it not hosted anywhere as a repo?

laxman01 commented 11 years ago

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

Raggyx commented 11 years ago

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

laxman01 commented 11 years ago

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

Raggyx commented 11 years ago

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'

laxman01 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

This is currently where i'm at.

laxman01 commented 11 years ago

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 commented 11 years ago

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

new error

laxman01 commented 11 years ago

Please someone help me

Raggyx commented 11 years ago

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

Deanmv commented 11 years ago

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
laxman01 commented 11 years ago

Thank you so much for all of your help