Skip to content

Instantly share code, notes, and snippets.

@misspokeycat
Last active July 24, 2023 16:57
Show Gist options
  • Save misspokeycat/1e0f7ce4b36c02d143653e8c2a6cc282 to your computer and use it in GitHub Desktop.
Save misspokeycat/1e0f7ce4b36c02d143653e8c2a6cc282 to your computer and use it in GitHub Desktop.
# To deploy this script to your box:
# Open PowerShell
# Paste the following into the shell and run it:
# iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/pokemonmegaman/1e0f7ce4b36c02d143653e8c2a6cc282/raw/11bf0a34a18559096038c9d3bef6cefa9d549070/pokemap-deploy-windows.ps1'))
# Deployment script for Pokemon Go bot
# Installs python, node, python and node dependencies, and builds launch script.
# Must be ran as Admin.
# Download Python 2.7.12, install
mkdir pokemon-go-map
cd pokemon-go-map
If (-Not (Test-Path C:\Python27)){
echo "Downloading Python..."
Invoke-WebRequest -Uri "https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi" -OutFile "python.msi"
echo "Installing Python..."
msiexec /i python.msi /quiet
echo "Python Installed"
}
# Install Node.JS
If (-Not (Test-Path 'C:\Program Files\nodejs')){
echo "Downloading Node + NPM..."
Invoke-WebRequest -Uri "https://nodejs.org/dist/v4.4.7/node-v4.4.7-x64.msi" -OutFile "node.msi"
msiexec /quiet /i node.msi
echo "Node installed."
}
# Download development copy of map
echo "Downloading latest developer copy of map..."
Invoke-WebRequest -Uri https://github.com/AHAAAAAAA/PokemonGo-Map/archive/develop.zip -OutFile develop.zip
$shell = new-object -com shell.application
echo "Extracting map..."
$shell_app=new-object -com shell.application
$filename = "develop.zip"
$zip_file = $shell_app.namespace((Get-Location).Path + "\$filename")
$destination = $shell_app.namespace((Get-Location).Path)
$destination.Copyhere($zip_file.items())
cd PokemonGo-Map-develop
# Install map.
echo "Installing Node modules..."
npm install
echo "Installing Python packages..."
pip install -r requirements.txt
if (-Not($?)){
echo "Python install failed, downloading required C++ build libraries...(this might take a bit)"
Invoke-WebRequest -Uri https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi -OutFile VcForPython27.msi
echo "Installing libraries..."
msiexec /i VcForPython27.msi /quiet
echo "Retrying Python installation..."
pip install -r requirements.txt
rm VcForPython27.msi
}
# Cleanup MSI files.
echo "Cleaning up..."
rm develop.zip
rm node.msi
rm python.msi
echo "Downloading runscript..."
#TODO: Download my runscript for the map
echo "Setup complete!"
echo "In order to finish setup, you will need to create a Google Maps API key."
echo "Pressing enter will take you to the site to get one, or you can head over to https://goo.gl/IlhuUH and get one too."
echo "Also, it is strongly encouraged to make a throwaway account for Pokemon Go for the map to use."
echo "For your map to be viewable remotely, you will need to also open a port on your router for the map to talk on."
pause
Start-Process "https://goo.gl/IlhuUH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment