Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve README #42

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

## iOS device as game controller
![Alt text](Assets/controller.png?raw=true "controller")
Clone this xcode project and run on your iphone / ipad, this app actually perform a web server that tells your chosen location, your location will be wherever the poke ball is, so you may drag the map of press the buttons.
Clone this Xcode project and run on your iPhone / iPad, this app actually performs a web server that tells your chosen location, your location will be wherever the poke ball is, so you may drag the map of press the buttons.

```js
{ "lng": "114.132530212402", "lat": "22.3636264801025" }
```
{"lng":"114.132530212402","lat":"22.3636264801025"}
```
This is what the app response via port 80 by http, so be sure to connect the iphone / ipad to your wifi network in order to gain access.
This is what the app response via port 80 by http, so be sure to connect the iPhone / iPad to your WiFi network in order to gain access.

## Get controller message
```python
Expand Down Expand Up @@ -47,24 +47,24 @@ def start():

start()
```
Edit readAndChangeXML.py ,change the urlopen address to your controller's ip and write to somewhere your gpx file you want to put. Be sure you remember where the gpx you put :)
Edit `readAndChangeXML.py`, change the `urlopen` address to your controller's IP and write to somewhere your `gpx` file you want to put. Be sure you remember where the `gpx` you put. :)

![Alt text](Assets/receiver.png?raw=true "controller")
If running normal, at console you should see something like this when your drag the map or press the buttons on your game controller.

## Simulate location to target device
![Alt text](Assets/blankProject.png?raw=true "controller")
Create a blank single page app with your Xcode. Remember where you put the gpx file? Import the gpx file to your project without copying it, just referencing.
Create a blank single page app with your Xcode. Remember where you put the `gpx` file? Import the `gpx` file to your project without copying it, just referencing.

![Alt text](Assets/xcodeSimulate.png?raw=true "controller")
Run this project on your iOS device that will actually run the Pokemon Go game, when running, at Xcode you will see a button to simulate location, so you see the option of your gpx file. Our next step is to constantly press this two buttons to simulate your location constantly and automatically.
Run this project on your iOS device that will actually run the Pokemon Go game, when running, at Xcode you will see a button to simulate location, so you see the option of your `gpx` file. Our next step is to constantly press this two buttons to simulate your location constantly and automatically.

http://stackoverflow.com/questions/4230867/how-do-i-simulate-a-mouse-click-through-the-mac-terminal/26687223
https://stackoverflow.com/questions/4230867/how-do-i-simulate-a-mouse-click-through-the-mac-terminal/26687223
By this, we can simulate a / some / lot of click(s) programmatically
```
```shell
gcc -o autoClicker autoClicker.m -framework ApplicationServices -framework Foundation
```
compile the autoClicker.m with gcc at terminal.
compile the `autoClicker.m` with gcc at terminal.

```python
import os
Expand Down Expand Up @@ -92,13 +92,13 @@ def start():

start()
```
So change the x,y location of your xcode's simulate button. LOL don't ask me your x,y, find it and test it by yourself, to have it easy when adjusting your x,y, you may set the sleep time longer among loops :) more tip: the loop will stop if you close the game controller as it looks for the active state on game controller, so please change the urlopen address here too with your game controller's ip.
So change the X,Y location of your Xcode's simulate button. LOL don't ask me your X,Y, find it and test it by yourself, to have it easy when adjusting your X,Y, you may set the sleep time longer among loops :) More tip: the loop will stop if you close the game controller as it looks for the active state on game controller, so please change the `urlopen` address here too with your game controller's IP.

## Overall flow
1. you provide location data on game controller
2. receive it and generate gpx file constantly when you move
3. blank project referencing the gpx and simulate on your playing device
4. auto click the xcode buttons constantly
1. You provide location data on game controller
2. Receive it and generate `gpx` file constantly when you move
3. Blank project referencing the `gpx` and simulate on your playing device
4. Auto click the Xcode buttons constantly

# Have Fun!
![Alt text](Assets/finalResult.png?raw=true "final result")
![Alt text](Assets/finalResult.png?raw=true "final result")