plamoni / SiriProxy

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

Console doesn't run some commands #512

Closed Deanmv closed 11 years ago

Deanmv commented 11 years ago

Commands that work fine when actually used with Siri are not recognised when ran in the console. For example:

  listen_for /siri proxy number ([0-9,]*[0-9])/i do |number|
    while number.empty? do
        number = ask "Please say a number"
    end
    say "Detected number: #{number}"
       request_completed
    end

In console if I enter "siri proxy number 12" then everything works fine.

Whereas if I enter "siri proxy number" I don't get the prompt asking me what number and it does not run the while loop. If it's ran properly through Siri then the while loop works fine.

elvisimprsntr commented 11 years ago

typically, optional words are bracketed with the ?, example (?: of)? You cannot capture the optional words.

Basically I think you are trying to do something in a single regex expression which it cannot support. try creating two separate listen_for statements, one with an one without the number.

Or try tweaking the regex expression using applicable syntax. http://regexcheatsheet.com

Deanmv commented 11 years ago

It doesn't really bother me that it doesn't work, I know it does when I actually use Siri, it is just easier to test on the console. Just didn't know if it was anything I was doing or the actual Siri Proxy.

elvisimprsntr commented 11 years ago

ok. i am closing