Code:
; RUN SCRIPT AS ADMINISTRATOR (Right-click, Run As Administrator)
; Change input keyboard language to United States International.
; Config
workingdir = "C:\pokesniper\" ; Working directory
sniper = "PokeSniper2.exe" ; Location where sniper is stored
usexml = Y ; Set to 'Y' or 'N'
; OPTIONAL - BEGIN
; If you do not use the 'user.xml' file, enter your data below. If you set usexml = Y you do not have to edit the data below.
; To avoid a softban, your current location is required.
latitude = 51.98236919602906
longitude = 5.90440034866333
altitude = 10 ; Default is 10
loginmethod = 1 ; Set to 1 for Google, set to 2 for PTC
username = USERNAME ; email for Google, or username for PTC
password = PASSWORD ; password for Google, or password for PTC
; OPTIONAL - END
Loop
{
; Get the Pokemon JSON information
succes = false
Loop {
urldownloadtofile , http://pokesnipers.com/api/v1/pokemon.json , c:\pokemon.json
FileRead , page , c:\pokemon.json
; Test if page is not timed out, not found, or gives another error
IfNotInString, page, error
succes = true
} Until succes == "true"
; Retrieve name, latitude, longitude, and start sniper for each Pokemon
StringReplace, page, page, "}`, , ¢, All
Loop , parse , page , ¢
{
line := A_LoopField
linesplit := StrSplit(line , ",")
; Get name
name := linesplit[2]
StringTrimLeft, name , name , 8
StringTrimRight, name , name , 1
; Get latitude coordinate
lat := linesplit[3]
StringTrimLeft, lat , lat , 10
; Add longitude coordinate
long := linesplit[4]
StringTrimRight, long , long , 1
; Concatenate latitude and longitude
coords = %lat%,%long%
;Run %comspec% /c cd "%workingdir%" && "%sniper%"
;Run, %comspec% /k cd "%workingdir%", , max
Run, cmd.exe, , max
WinWaitActive, cmd.exe,,1
SendInput {Raw} cd %workingdir%
SendInput {Enter}
SendInput {Raw} %workingdir%\%sniper%
SendInput {Enter}
if (%usexml% == Y)
{
SendInput %usexml%{Enter}%name%{Enter}%coords%{Enter}
}
else
{
SendInput %usexml%
SendInput %loginmethod%
SendInput %latitude%{Enter}%longitude%{Enter}%altitude%{Enter}
SendInput {Raw} %username%
SendInput {Enter}
SendInput {Raw} %password%
SendInput {Enter}{Enter}
SendInput %name%{Enter}%coords%{Enter}
}
sleep, 10000 ; wait several seconds (1000 = 1 second) to finish catching Pokemon
SendInput xxexit{Enter}
}
sleep, 60000 ; sleep some seconds (1000 = 1 second) and snipe again!
}