kahopoon / Pokemon-Go-Controller

play pokemon go safely or at unavailable area
2.47k stars 275 forks source link

autoclicking prevents users from using the simulator #29

Open Kampfgnom opened 8 years ago

Kampfgnom commented 8 years ago

You could instead add an applescript, which calls the menu item:

tell application "System Events" to tell process "Xcode"
    click menu item "pokemonLocation" of menu 1 of menu item "Simulate Location" of menu 1 of menu bar item "Debug" of menu bar 1
end tell

Currently I am running this thingy when the gpx file changes via nodemon: nodemon -e gpx --exec osascript setlocation.applescript

This works better than the current solution.

Jonathanwb commented 8 years ago

This is a great solution, the other way had me way confused. Thanks!

dpodhorsky commented 8 years ago

I am having issues with AppleScript executing the above script. it gives error "error "System Events got an error: Can’t get menu item \"pokemonLocation\" of menu 1 of menu item \"Simulate Location\" of menu 1 of menu bar item \"Debug\" of menu bar 1 of process \"Xcode\"." number -1728 from menu item "pokemonLocation" of menu 1 of menu item "Simulate Location" of menu 1 of menu bar item "Debug" of menu bar 1 of process "Xcode""

wangjunji commented 8 years ago

@dpodhorsky +1

soffchen commented 8 years ago

Great solution

windse7en commented 8 years ago

Nice work +1

HelloCore commented 8 years ago

@dpodhorsky For your problem, you have to go to System Preferences > Security & Privacy. Then, you have to add Xcode to Accessibility tap.

scottiesan commented 8 years ago

You add repeat command and eliminate the nodemond;

repeat tell application "System Events" to tell process "Xcode" click menu item "pokemonLocation" of menu 1 of menu item "Simulate Location" of menu 1 of menu bar item "Debug" of menu bar 1 end tell delay 0.1 end repeat