├── .gitattributes
├── GoBot.sln
├── GoBot
├── App.config
├── DarkTheme.cs
├── EventReceiver.cs
├── FrmMain.Designer.cs
├── FrmMain.cs
├── FrmMain.resx
├── GoBot.csproj
├── GoBot.csproj.user
├── ListViewColumnSorter.cs
├── Logic
│ ├── Actions.cs
│ ├── BotInstance.cs
│ └── Inventory.cs
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── UserLogger
│ ├── EventLogger.cs
│ └── ILogger.cs
├── UserSettings.cs
├── Utils
│ ├── Delay.cs
│ ├── Events.cs
│ ├── LocationUtils.cs
│ ├── Navigation.cs
│ ├── NumberUtils.cs
│ ├── Settings.cs
│ ├── Statistics.cs
│ └── StringUtils.cs
├── ash.png
├── go.ico
├── marker.png
└── packages.config
├── LICENSE.md
├── README.md
└── packages
├── GMap.NET.WindowsForms.1.7.1
├── GMap.NET.WindowsForms.1.7.1.nupkg
├── lib
│ ├── net20
│ │ ├── GMap.NET.Core.dll
│ │ ├── GMap.NET.Core.xml
│ │ ├── GMap.NET.WindowsForms.dll
│ │ └── GMap.NET.WindowsForms.xml
│ └── net40
│ │ ├── GMap.NET.Core.dll
│ │ ├── GMap.NET.Core.xml
│ │ ├── GMap.NET.WindowsForms.dll
│ │ └── GMap.NET.WindowsForms.xml
└── readme.txt
└── GoogleMapsApi.0.56.0
├── GoogleMapsApi.0.56.0.nupkg
└── lib
└── net45
├── GoogleMapsApi.dll
└── GoogleMapsApi.xml
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/GoBot.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25123.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoBot", "GoBot\GoBot.csproj", "{3151326F-7BBE-4EC1-BEF3-61DA43A98E01}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {3151326F-7BBE-4EC1-BEF3-61DA43A98E01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {3151326F-7BBE-4EC1-BEF3-61DA43A98E01}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {3151326F-7BBE-4EC1-BEF3-61DA43A98E01}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {3151326F-7BBE-4EC1-BEF3-61DA43A98E01}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/GoBot/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Auth Token
15 |
16 |
17 | Username
18 |
19 |
20 | Password
21 |
22 |
23 | Ptc
24 |
25 |
26 | 0
27 |
28 |
29 | 0
30 |
31 |
32 | 0
33 |
34 |
35 | 50
36 |
37 |
38 | 25
39 |
40 |
41 | 50
42 |
43 |
44 | 50
45 |
46 |
47 | 100
48 |
49 |
50 | 25
51 |
52 |
53 | 100
54 |
55 |
56 | 25
57 |
58 |
59 | 40
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/GoBot/EventReceiver.cs:
--------------------------------------------------------------------------------
1 | using GoBot.Logic;
2 | using GoBot.UserLogger;
3 | using GoBot.Utils;
4 | using POGOProtos.Data;
5 | using System;
6 |
7 | namespace GoBot
8 | {
9 | public class EventReceiver
10 | {
11 | public BotInstance bot;
12 | public void Set()
13 | {
14 | GoBot.Utils.Events.OnPokemonCaught += Events_OnPokemonCaught;
15 | GoBot.Utils.Events.OnFortFarmed += Events_OnFortFarmed;
16 | }
17 |
18 | private async void Events_OnFortFarmed(object sender, Utils.FortFarmedArgs e)
19 | {
20 | try
21 | {
22 | await bot.TransferDuplicatePokemon(UserSettings.KeepCP, false);
23 | await T.Delay(bot.rand.Next(4500, 7000));
24 | await bot.EvolvePokemonFromList();
25 | await T.Delay(bot.rand.Next(4500, 7000));
26 | await bot.RecycleItems();
27 | await T.Delay(bot.rand.Next(4500, 7000));
28 | Utils.Events.FortFarmedReset.Set();
29 | }
30 | catch (Exception ex)
31 | {
32 | Logger.Write($"Exception: {ex}", LogLevel.Error, ConsoleColor.Red);
33 | Utils.Events.FortFarmedReset.Set();
34 | }
35 | }
36 | private async void Events_OnPokemonCaught(object sender, Utils.PokemonCaughtArgs e)
37 | {
38 | try
39 | {
40 | // Id is zero because it has not been caught 'yet' as it is a 'wild' encounter
41 | PokemonData pokeData = e.CaughtPokemon;
42 | if (pokeData != null)
43 | {
44 | if (!bot.CatchList.Contains(pokeData.PokemonId))
45 | {
46 | // transfer but wait a bit before
47 | await T.Delay(bot.rand.Next(9000, 15000));
48 | //var actualPokemon = await bot._inventory.GetLastCaughtPokemon(pokeData);
49 |
50 |
51 | var resp = await bot._client.Inventory.TransferPokemon(e.CaughtID);
52 | // stats
53 | if (resp.Result == POGOProtos.Networking.Responses.ReleasePokemonResponse.Types.Result.Success)
54 | {
55 | bot._stats.increasePokemonsTransfered();
56 | bot._stats.updateConsoleTitle(bot._inventory);
57 | Logger.Write($"Transferred {pokeData.PokemonId} with {pokeData.Cp} CP (Pokemon was not in Catch list!)", LogLevel.Info, ConsoleColor.DarkGreen);
58 | }
59 |
60 |
61 | }
62 | else
63 | {
64 | // CHANGED FROM AND TO OR
65 | if (pokeData.Cp < UserSettings.CatchOverCP || BotInstance.CalculatePokemonPerfection(pokeData) < UserSettings.CatchOverIV)
66 | {
67 | await T.Delay(bot.rand.Next(9000, 15000));
68 | var actualPokemon = await bot._inventory.GetPokemonById(e.CaughtID);//await bot._inventory.GetLastCaughtPokemon(pokeData);
69 | if (actualPokemon != null)
70 | {
71 | var highest = await bot._inventory.GetHighestPokemonOfTypeByCP(actualPokemon);
72 |
73 | // if it's not the highest
74 | if (highest.Id != actualPokemon.Id)
75 | {
76 |
77 | var resp = await bot._client.Inventory.TransferPokemon(actualPokemon.Id);
78 | // stats
79 | if (resp.Result == POGOProtos.Networking.Responses.ReleasePokemonResponse.Types.Result.Success)
80 | {
81 | bot._stats.increasePokemonsTransfered();
82 | bot._stats.updateConsoleTitle(bot._inventory);
83 | Logger.Write($"Transferred {pokeData.PokemonId} with {pokeData.Cp} CP ({BotInstance.CalculatePokemonPerfection(pokeData).ToString("0.00")}%) (Under Requirement)", LogLevel.Info, ConsoleColor.DarkGreen);
84 | }
85 | }
86 | else
87 | {
88 |
89 | Logger.Write($"Did NOT transfer {pokeData.PokemonId} with {pokeData.Cp} CP ({BotInstance.CalculatePokemonPerfection(pokeData).ToString("0.00")}%) (Highest in Group)", LogLevel.Info, ConsoleColor.DarkGreen);
90 |
91 | }
92 | }
93 | else
94 | {
95 | Logger.Write("The pokemon was not found in our inventory? If you're getting this, then something is very wrong.");
96 | }
97 |
98 | }
99 | else
100 | {
101 | await T.Delay(5000);
102 |
103 | }
104 | }
105 | }
106 | await bot.TransferDuplicatePokemon(UserSettings.KeepCP, false);
107 | await T.Delay(bot.rand.Next(4500, 7000));
108 | await bot.RecycleItems();
109 | await T.Delay(bot.rand.Next(4500, 7000));
110 | Utils.Events.PokemonCaughtReset.Set();
111 | }
112 | catch (Exception ex)
113 | {
114 | Logger.Write($"Exception: {ex}", LogLevel.Error, ConsoleColor.Red);
115 | Utils.Events.PokemonCaughtReset.Set();
116 | }
117 | }
118 |
119 |
120 |
121 | }
122 |
123 | }
124 |
--------------------------------------------------------------------------------
/GoBot/FrmMain.cs:
--------------------------------------------------------------------------------
1 | using GMap.NET;
2 | using GMap.NET.WindowsForms;
3 | using GMap.NET.WindowsForms.Markers;
4 | using GoBot.Logic;
5 | using GoBot.UserLogger;
6 | using GoBot.Utils;
7 | using POGOProtos.Data;
8 | using POGOProtos.Enums;
9 | using POGOProtos.Inventory;
10 | using POGOProtos.Inventory.Item;
11 | using System;
12 | using System.Collections;
13 | using System.Collections.Generic;
14 | using System.Data;
15 | using System.Drawing;
16 | using System.Linq;
17 | using System.Threading;
18 | using System.Threading.Tasks;
19 | using System.Windows.Forms;
20 |
21 | namespace GoBot
22 | {
23 | public partial class FrmMain : Form
24 | {
25 | private Sorter itemSorter;
26 | private Sorter pokemonSorter;
27 | public BotInstance bot;
28 | public EventReceiver rec;
29 |
30 | private GMapOverlay mOverlay = new GMapOverlay("markers");
31 | private GMapOverlay pOverlay = new GMapOverlay("routes");
32 | private GMapMarker m;
33 | private GMapMarker dest;
34 |
35 | private PointLatLng lastDestination;
36 | public FrmMain()
37 | {
38 | InitializeComponent();
39 | rec = new EventReceiver();
40 | cbAuthType.SelectedIndex = 0;
41 | itemSorter = new Sorter();
42 | pokemonSorter = new Sorter();
43 | lvBalls.ListViewItemSorter = itemSorter;
44 | lvPokemon.ListViewItemSorter = pokemonSorter;
45 |
46 | }
47 |
48 | private void FrmMain_Load(object sender, EventArgs e)
49 | {
50 | Logger.SetLogger(new UserLogger.EventLogger(LogLevel.Info));
51 |
52 |
53 | LoadPokemon(clbCatch);
54 | LoadPokemon(clbEvolve);
55 | LoadPokemon(clbTransfer);
56 | LoadPokemon(clbBerries);
57 | rec.Set();
58 |
59 | GoBot.Utils.Events.OnMessageReceived += Events_OnMessageReceived;
60 |
61 | foreach (ColumnHeader ch in lvBalls.Columns)
62 | {
63 | string appendText = "< ";
64 | ch.Text = appendText + ch.Text;
65 | }
66 | foreach (ColumnHeader ch in lvPokemon.Columns)
67 | {
68 | string appendText = "< ";
69 | ch.Text = appendText + ch.Text;
70 | }
71 |
72 | LoadSettings();
73 |
74 |
75 |
76 | }
77 |
78 | private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
79 | {
80 | SaveSettings();
81 | // I do this because it may not exit or a thread may be open still...
82 | Environment.Exit(0);
83 | }
84 | #region Settings
85 | private void LoadSettings()
86 | {
87 | try
88 | {
89 | UserSettings.GoogleRefreshToken = Properties.Settings.Default.GoogleAuthValue;
90 | txtUser.Text = Properties.Settings.Default.Username;
91 | txtPass.Text = Properties.Settings.Default.Password;
92 |
93 |
94 | txtLat.Text = Properties.Settings.Default.Lat.ToString();
95 | txtLng.Text = Properties.Settings.Default.Lng.ToString();
96 | txtAltitude.Text = Properties.Settings.Default.Altitude.ToString();
97 |
98 |
99 | cbAuthType.SelectedIndex = Properties.Settings.Default.AuthType == "Ptc" ? 0 : 1;
100 |
101 | Logger.Write($"Google Token: {UserSettings.GoogleRefreshToken}");
102 |
103 | // all settings for pokemon page
104 | txtEvolveCp.Text = Properties.Settings.Default.EvolveCP.ToString();
105 | txtEvolveIV.Text = Properties.Settings.Default.EvolveIV.ToString();
106 |
107 | txtCatchCp.Text = Properties.Settings.Default.CatchCP.ToString();
108 | txtCatchIV.Text = Properties.Settings.Default.CatchIV.ToString();
109 |
110 | txtTransferCp.Text = Properties.Settings.Default.TransferCP.ToString();
111 | txtTransferIV.Text = Properties.Settings.Default.TransferIV.ToString();
112 |
113 | txtProbability.Text = Properties.Settings.Default.BerriesProbability.ToString();
114 |
115 | txtOverrideCP.Text = Properties.Settings.Default.OverrideCP.ToString();
116 | txtOverrideIV.Text = Properties.Settings.Default.OverrideIV.ToString();
117 |
118 | // load lists
119 | LoadCheckedFromArray(Properties.Settings.Default.Evolve, clbEvolve);
120 | LoadCheckedFromArray(Properties.Settings.Default.Catch, clbCatch);
121 | LoadCheckedFromArray(Properties.Settings.Default.Transfer, clbTransfer);
122 | LoadCheckedFromArray(Properties.Settings.Default.Berries, clbBerries);
123 |
124 | // load recycling settings
125 | ArrayList recycleList = Properties.Settings.Default.RecycleList;
126 | if (recycleList != null && recycleList.Count > 0)
127 | {
128 | string[] rList = recycleList.ToArray().Cast().ToArray();
129 |
130 | int set = 0;
131 |
132 | txtPB.Text = rList[set++];
133 | txtGPB.Text = rList[set++];
134 | txtUPB.Text = rList[set++];
135 |
136 | txtP.Text = rList[set++];
137 | txtSP.Text = rList[set++];
138 | txtHP.Text = rList[set++];
139 | txtMP.Text = rList[set++];
140 |
141 | txtRevive.Text = rList[set++];
142 | txtMaxRevive.Text = rList[set++];
143 |
144 | txtRB.Text = rList[set++];
145 |
146 | }
147 | }
148 | catch (Exception ex)
149 | {
150 | MsgError(ex.ToString());
151 | }
152 | }
153 | private void SaveSettings()
154 | {
155 | try
156 | {
157 | Properties.Settings.Default.GoogleAuthValue = string.IsNullOrEmpty(UserSettings.GoogleRefreshToken) ? "" : UserSettings.GoogleRefreshToken;
158 | Properties.Settings.Default.Username = txtUser.Text;
159 | Properties.Settings.Default.Password = txtPass.Text;
160 |
161 | if (!chkRememberCoords.Checked || bot == null)
162 | {
163 | Properties.Settings.Default.Lat = txtLat.Text.ToDouble();
164 | Properties.Settings.Default.Lng = txtLng.Text.ToDouble();
165 | }
166 | else
167 | {
168 |
169 | Properties.Settings.Default.Lat = bot._client.CurrentLatitude;
170 | Properties.Settings.Default.Lng = bot._client.CurrentLongitude;
171 | }
172 |
173 | Properties.Settings.Default.Altitude = txtAltitude.Text.ToInt();
174 |
175 | // save lists
176 | Properties.Settings.Default.Evolve = new ArrayList((chkInverseEvolve.Checked ? GetInverseList(clbEvolve) : GetList(clbEvolve)).Select(i => i.ToString()).ToArray());
177 | Properties.Settings.Default.Catch = new ArrayList((chkInverseCatch.Checked ? GetInverseList(clbCatch) : GetList(clbCatch)).Select(i => i.ToString()).ToArray());
178 | Properties.Settings.Default.Transfer = new ArrayList((chkInverseTransfer.Checked ? GetInverseList(clbTransfer) : GetList(clbTransfer)).Select(i => i.ToString()).ToArray());
179 | Properties.Settings.Default.Berries = new ArrayList((chkInverseBerries.Checked ? GetInverseList(clbBerries) : GetList(clbBerries)).Select(i => i.ToString()).ToArray());
180 |
181 | // save text data
182 | Properties.Settings.Default.EvolveCP = txtEvolveCp.Text.ToInt();
183 | Properties.Settings.Default.EvolveIV = txtEvolveIV.Text.ToInt();
184 |
185 | Properties.Settings.Default.CatchCP = txtCatchCp.Text.ToInt();
186 | Properties.Settings.Default.CatchIV = txtCatchIV.Text.ToInt();
187 |
188 | Properties.Settings.Default.TransferCP = txtTransferCp.Text.ToInt();
189 | Properties.Settings.Default.TransferIV = txtTransferIV.Text.ToInt();
190 |
191 | Properties.Settings.Default.BerriesProbability = txtProbability.Text.ToInt();
192 |
193 | Properties.Settings.Default.OverrideCP = txtOverrideCP.Text.ToInt();
194 | Properties.Settings.Default.OverrideIV = txtOverrideIV.Text.ToInt();
195 |
196 | // recycle settings
197 | int set = 0;
198 | string[] rList = new string[10];
199 |
200 | rList[set++] = txtPB.Text;
201 | rList[set++] = txtGPB.Text;
202 | rList[set++] = txtUPB.Text;
203 |
204 | rList[set++] = txtP.Text;
205 | rList[set++] = txtSP.Text;
206 | rList[set++] = txtHP.Text;
207 | rList[set++] = txtMP.Text;
208 |
209 | rList[set++] = txtRevive.Text;
210 | rList[set++] = txtMaxRevive.Text;
211 |
212 | rList[set++] = txtRB.Text;
213 |
214 | Properties.Settings.Default.RecycleList = new ArrayList(rList);
215 |
216 | Properties.Settings.Default.Save();
217 | }
218 | catch (Exception ex)
219 | {
220 | MsgError($"Exception: {ex}");
221 | }
222 |
223 | }
224 | #endregion
225 |
226 | #region Listview Sorting and Events
227 | private void lvBalls_ColumnClick(object sender, ColumnClickEventArgs e)
228 | {
229 | itemSorter.Column = e.Column;
230 | // Reverse the current sort direction for this column.
231 | string appendText = "< ";
232 | if (itemSorter.Order == SortOrder.Ascending)
233 | {
234 | itemSorter.Order = SortOrder.Descending;
235 | appendText = "> ";
236 |
237 | }
238 | else
239 | {
240 | itemSorter.Order = SortOrder.Ascending;
241 | }
242 |
243 | lvBalls.Columns[e.Column].Text = appendText + lvBalls.Columns[e.Column].Text.Substring(2);
244 |
245 | // Perform the sort with these new sort options.
246 | lvBalls.Sort();
247 | }
248 |
249 | private void lvPokemon_ColumnClick(object sender, ColumnClickEventArgs e)
250 | {
251 | pokemonSorter.Column = e.Column;
252 | // Reverse the current sort direction for this column.
253 | string appendText = "< ";
254 | if (pokemonSorter.Order == SortOrder.Ascending)
255 | {
256 | pokemonSorter.Order = SortOrder.Descending;
257 | appendText = "> ";
258 |
259 | }
260 | else
261 | {
262 | pokemonSorter.Order = SortOrder.Ascending;
263 | }
264 |
265 | lvPokemon.Columns[e.Column].Text = appendText + lvPokemon.Columns[e.Column].Text.Substring(2);
266 |
267 | // Perform the sort with these new sort options.
268 | lvPokemon.Sort();
269 | }
270 |
271 | private void Events_OnMessageReceived(object sender, Utils.LogReceivedArgs e)
272 | {
273 | try
274 | {
275 | if (!this.IsHandleCreated)
276 | return;
277 |
278 | this.Invoke((MethodInvoker)delegate ()
279 | {
280 | // clear log
281 | if (lvWalkLog.Items.Count > 300)
282 | lvWalkLog.Items.Clear();
283 |
284 | ListViewItem lvi = new ListViewItem($"[{ DateTime.Now.ToString("HH:mm:ss")}]");
285 | lvi.UseItemStyleForSubItems = true;
286 |
287 | lvi.SubItems.Add(e.Message);
288 |
289 | lvi.ForeColor = e.Color;
290 |
291 | lvWalkLog.Items.Add(lvi);
292 |
293 | lvWalkLog.Items[lvWalkLog.Items.Count - 1].EnsureVisible();
294 | });
295 | }
296 | catch (Exception ex)
297 | {
298 |
299 | }
300 | }
301 | #endregion
302 |
303 | #region Functions
304 | private void MsgInfo(string msg)
305 | {
306 | MessageBox.Show(msg, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
307 | }
308 | private void MsgError(string msg)
309 | {
310 | MessageBox.Show(msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
311 | }
312 |
313 | private void LoadCheckedFromArray(ArrayList array, CheckedListBox clb)
314 | {
315 | if (array == null || array.Count == 0)
316 | return;
317 |
318 | foreach (var item in array)
319 | {
320 | string pokemon = (string)item;
321 | int index = clb.Items.IndexOf(pokemon);
322 | if (index != -1)
323 | clb.SetItemChecked(index, true);
324 | }
325 | }
326 | private void LoadPokemon(CheckedListBox clb)
327 | {
328 | foreach (PokemonId pid in Enum.GetValues(typeof(PokemonId)))
329 | {
330 | clb.Items.Add(pid.ToString());
331 | }
332 |
333 | clb.Sorted = true;
334 | clb.Sorted = false;
335 | clb.Items.Insert(0, "All");
336 | }
337 | private List GetInverseList(CheckedListBox clb)
338 | {
339 | List pids = new List();
340 | pids.AddRange(Enum.GetValues(typeof(PokemonId)).Cast().ToList());
341 |
342 | foreach (string str in clb.CheckedItems)
343 | {
344 | if (str == "All")
345 | continue;
346 | pids.Remove((PokemonId)Enum.Parse(typeof(PokemonId), str));
347 | }
348 | return pids;
349 | }
350 | private List GetList(CheckedListBox clb)
351 | {
352 | List pids = new List();
353 |
354 |
355 | foreach (string str in clb.CheckedItems)
356 | {
357 | if (str == "All")
358 | {
359 | pids.AddRange(Enum.GetValues(typeof(PokemonId)).Cast().ToList());
360 | break;
361 | }
362 | else
363 | {
364 | pids.Add((PokemonId)Enum.Parse(typeof(PokemonId), str));
365 | }
366 |
367 | }
368 | return pids;
369 | }
370 |
371 | private void ReloadMap(bool over = false)
372 | {
373 | gmap.ShowCenter = false;
374 | if (over || gmap.Position.Lat != bot._client.CurrentLatitude && gmap.Position.Lng != bot._client.CurrentLongitude)
375 | {
376 |
377 | mOverlay.Markers.Remove(m);
378 |
379 | gmap.Position = new GMap.NET.PointLatLng(bot._client.CurrentLatitude, bot._client.CurrentLongitude);
380 |
381 | m = new GMarkerGoogle(gmap.Position, Properties.Resources.ash);
382 |
383 | mOverlay.Markers.Add(m);
384 |
385 |
386 |
387 | if (over)
388 | {
389 | gmap.Overlays.Add(mOverlay);
390 | gmap.Overlays.Add(pOverlay);
391 | gmap.Zoom = 17;
392 | }
393 |
394 |
395 | }
396 |
397 | if (bot._navigation.FinalDestination != null && lastDestination.Lat != bot._navigation.FinalDestination.Latitude && lastDestination.Lng != bot._navigation.FinalDestination.Longitude)
398 | {
399 |
400 | pOverlay.Clear();
401 | foreach (var x in bot._navigation.DestinationSteps)
402 | {
403 |
404 | GMapRoute r = new GMapRoute(x, "Steps" + Guid.NewGuid().ToString());
405 | r.Stroke = new Pen(Color.Red, 3);
406 |
407 | pOverlay.Routes.Add(r);
408 | }
409 |
410 | mOverlay.Markers.Remove(dest);
411 |
412 | dest = new GMarkerGoogle(new PointLatLng(bot._navigation.FinalDestination.Latitude, bot._navigation.FinalDestination.Longitude), Properties.Resources.marker);
413 |
414 | mOverlay.Markers.Add(dest);
415 |
416 |
417 | lastDestination = new PointLatLng(bot._navigation.FinalDestination.Latitude, bot._navigation.FinalDestination.Longitude);
418 | }
419 | }
420 | #endregion
421 | private async void btnStart_Click(object sender, EventArgs e)
422 | {
423 | UserSettings.KeepCP = (txtTransferCp.Text).ToInt();
424 | UserSettings.EvolveOverCP = (txtEvolveCp.Text).ToInt();
425 | UserSettings.CatchOverCP = (txtCatchCp.Text).ToInt();
426 |
427 | UserSettings.KeepIV = (txtTransferIV.Text).ToInt();
428 | UserSettings.CatchOverIV = (txtCatchIV.Text).ToInt();
429 | UserSettings.EvolveOverIV = (txtEvolveIV.Text).ToInt();
430 |
431 | UserSettings.Username = txtUser.Text;
432 | UserSettings.Password = txtPass.Text;
433 | UserSettings.Auth = cbAuthType.SelectedIndex == 0 ? PokemonGo.RocketAPI.Enums.AuthType.Ptc : PokemonGo.RocketAPI.Enums.AuthType.Google;
434 | UserSettings.UseBerries = clbBerries.CheckedItems.Count > 0;
435 | UserSettings.BerryProbability = txtProbability.Text.ToInt();
436 |
437 | UserSettings.WalkingSpeed = txtWalkSpeed.Text.ToInt();
438 | UserSettings.StartLat = (txtLat.Text).ToDouble();
439 | UserSettings.StartLng = (txtLng.Text).ToDouble();
440 | UserSettings.CatchPokemon = chkCatchPokes.Checked;
441 | UserSettings.GetForts = chkGetForts.Checked;
442 |
443 | UserSettings.TopX = (txtTopX.Text).ToInt();
444 |
445 | UserSettings.Altitude = (txtAltitude.Text).ToDouble();
446 |
447 | UserSettings.Teleport = chkTeleport.Checked;
448 | UserSettings.UseDelays = !chkNoDelay.Checked;
449 | UserSettings.UseGoogleDirections = chkGoogleDirections.Checked;
450 |
451 | UserSettings.TeleportToPokemonOnWalk = chkTeleportPokemonWalk.Checked;
452 | UserSettings.CatchPokemonOnWalk = chkCatchNearbyWalk.Checked;
453 | UserSettings.CatchWalkRadius = txtCatchRadiusWalk.Text.ToInt();
454 |
455 | UserSettings.NoDupeForts = chkAvoidDupeForts.Checked;
456 |
457 |
458 | Settings settings = new Settings();
459 |
460 |
461 | UserSettings.recycleSettings.Add((txtPB.Text).ToInt());
462 | UserSettings.recycleSettings.Add((txtGPB.Text).ToInt());
463 | UserSettings.recycleSettings.Add((txtUPB.Text).ToInt());
464 | UserSettings.recycleSettings.Add((txtP.Text).ToInt());
465 | UserSettings.recycleSettings.Add((txtSP.Text).ToInt());
466 | UserSettings.recycleSettings.Add((txtHP.Text).ToInt());
467 | UserSettings.recycleSettings.Add((txtMP.Text).ToInt());
468 | UserSettings.recycleSettings.Add((txtRevive.Text).ToInt());
469 | UserSettings.recycleSettings.Add((txtMaxRevive.Text).ToInt());
470 | UserSettings.recycleSettings.Add((txtRB.Text).ToInt());
471 |
472 | bot = new BotInstance(settings);
473 |
474 | bot.CatchList = chkInverseCatch.Checked ? GetInverseList(clbCatch) : GetList(clbCatch);
475 | bot.EvolveList = chkInverseEvolve.Checked ? GetInverseList(clbEvolve) : GetList(clbEvolve);
476 | bot.TransferList = chkInverseTransfer.Checked ? GetInverseList(clbTransfer) : GetList(clbTransfer);
477 | bot.BerryList = chkInverseBerries.Checked ? GetInverseList(clbBerries) : GetList(clbBerries);
478 |
479 | firstTick = true;
480 |
481 | rec.bot = bot;
482 | bot.Execute();
483 |
484 |
485 | tStats.Start();
486 | tMap.Start();
487 |
488 | btnStart.Enabled = false;
489 | btnStart.Scheme = cButton.Schemes.Green;
490 |
491 | btnStop.Enabled = true;
492 | btnStop.Scheme = cButton.Schemes.Red;
493 | }
494 |
495 | private void btnStop_Click(object sender, EventArgs e)
496 | {
497 | Logger.Write("Stop button hit!");
498 | bot.Stop();
499 | tStats.Stop();
500 | tMap.Stop();
501 | btnStart.Enabled = true;
502 | btnStart.Scheme = cButton.Schemes.Green;
503 |
504 | btnStop.Enabled = false;
505 | btnStop.Scheme = cButton.Schemes.Red;
506 | }
507 | private bool firstTick = true;
508 | private void tMap_Tick(object sender, EventArgs e)
509 | {
510 | try
511 | {
512 | if (firstTick)
513 | {
514 | // Load map
515 | gmap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
516 | GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerAndCache;
517 | gmap.Position = new GMap.NET.PointLatLng(UserSettings.StartLat, UserSettings.StartLng);
518 |
519 | ReloadMap(true);
520 | firstTick = false;
521 |
522 | }
523 | else
524 | {
525 | ReloadMap();
526 | }
527 | }
528 | catch (Exception ex)
529 | {
530 | Logger.Write("Map Timer Exception: " + ex.ToString(), LogLevel.Info, ConsoleColor.Red);
531 | }
532 | }
533 | private async void tStats_Tick(object sender, EventArgs e)
534 | {
535 |
536 | if (bot == null || !bot.running)
537 | return;
538 | try
539 | {
540 |
541 | lblFound.Text = Statistics.PokemonFound;
542 | lblTransferred.Text = Statistics.PokemonTransferred;
543 | lblStardust.Text = Statistics.Stardust;
544 | lblXP.Text = Statistics.ExperiencePerHour;
545 | lblCurLevel.Text = Statistics.PlayerLevel;
546 | lblLevelUp.Text = Statistics.LevelUp;
547 | lblRequiredXP.Text = Statistics.RequiredXP;
548 | //lblDump.Text = bot._stats.ToString();
549 | lblRuntime.Text = Statistics.ProgramRuntime;
550 | lblPokemonPerHour.Text = Statistics.PokemonPerHour;
551 |
552 |
553 | }
554 | catch (Exception ex)
555 | {
556 | Logger.Write($"Stat Timer Error: {ex}");
557 | }
558 | }
559 |
560 | private void btnResetSettings_Click(object sender, EventArgs e)
561 | {
562 | try
563 | {
564 | Properties.Settings.Default.Reset();
565 | Properties.Settings.Default.Save();
566 |
567 | Properties.Settings.Default.GoogleAuthValue = "";
568 | Properties.Settings.Default.Username = "Username";
569 | Properties.Settings.Default.Password = "Password";
570 | Properties.Settings.Default.Lat = 0;
571 | Properties.Settings.Default.Lng = 0;
572 | Properties.Settings.Default.Altitude = 0;
573 |
574 | Properties.Settings.Default.Save();
575 | }
576 | catch (Exception ex)
577 | {
578 | MsgError(ex.ToString());
579 | }
580 | }
581 |
582 | private async void btnEvolve_Click(object sender, EventArgs e)
583 | {
584 | if (bot == null || !bot.running)
585 | {
586 | MsgError("You cannot override when the bot is not running...");
587 | return;
588 | }
589 |
590 | if (!(MessageBox.Show("The override for evolve will evolve pokemon (in your inventory only) in the above CP and IV setting based on an OR statement. Filter lists WILL NOT APPLY.\r\n\r\nThis means that if you have 50 CP and 90% IV then it will evolve pokemon (with candy) that are OVER 49 CP OR that are greater than 89% IV.\r\n\r\nContinue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes))
591 | return;
592 |
593 | await bot.OverrideEvolve(txtOverrideCP.Text.ToInt(), txtOverrideIV.Text.ToInt());
594 | }
595 |
596 | private async void btnTransfer_Click(object sender, EventArgs e)
597 | {
598 | if (bot == null || !bot.running)
599 | {
600 | MsgError("You cannot override when the bot is not running...");
601 | return;
602 | }
603 |
604 | if (!(MessageBox.Show("The override for transfer will transfer pokemon (in your inventory only) in the above CP and IV setting based on an OR statement. This will TRANSFER EVERY POKEMON (REGARDLESS IF DUPE OR NOT). Filter lists WILL NOT APPLY.\r\n\r\nThis means that if you have 50 CP and 90% IV then it will transfer pokemon that are 49 CP or below OR that are less than 89% IV.\r\n\r\nContinue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes))
605 | return;
606 |
607 | if (txtOverrideCP.Text.ToInt() == 0 || txtOverrideIV.Text.ToInt() == 0)
608 | {
609 | if (!(MessageBox.Show("Warning, the IV and CP to override with have been set to 0. This will TRANSFER ALL POKEMON, IS THIS CORRECT?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes))
610 | return;
611 | }
612 |
613 |
614 | await bot.OverrideTransfer(txtOverrideCP.Text.ToInt(), txtOverrideIV.Text.ToInt());
615 | //await bot.TransferDuplicatePokemon(UserSettings.KeepCP, false);
616 | }
617 |
618 | private void cbAuthType_SelectedIndexChanged(object sender, EventArgs e)
619 | {
620 |
621 | }
622 |
623 | private async void refreshBallsToolStripMenuItem_Click(object sender, EventArgs e)
624 | {
625 | if (bot == null || !bot.running)
626 | {
627 | MsgError("You cannot refresh when the bot is not running...");
628 | return;
629 | }
630 | try
631 | {
632 | lvBalls.Items.Clear();
633 |
634 | var items = await bot._inventory.GetItems();
635 | var balls = items.Where(i => (i.ItemId == ItemId.ItemPokeBall
636 | || i.ItemId == ItemId.ItemGreatBall
637 | || i.ItemId == ItemId.ItemUltraBall
638 | || i.ItemId == ItemId.ItemMasterBall) && i.Count > 0).GroupBy(i => i.ItemId).ToList();
639 |
640 | int ballCount = 0;
641 |
642 | var pokeBalls = items.Where(i => i.ItemId == ItemId.ItemPokeBall).ToList();
643 | var greatBalls = items.Where(i => i.ItemId == ItemId.ItemGreatBall).ToList();
644 | var ultraBalls = items.Where(i => i.ItemId == ItemId.ItemUltraBall).ToList();
645 | var masterBalls = items.Where(i => i.ItemId == ItemId.ItemMasterBall).ToList();
646 |
647 |
648 |
649 | if (pokeBalls.Count > 0)
650 | {
651 | lvBalls.Items.Add(new ListViewItem(new[] { "Poke Balls", pokeBalls[0].Count.ToString() }));
652 | ballCount += pokeBalls[0].Count;
653 | }
654 | if (greatBalls.Count > 0)
655 | {
656 | lvBalls.Items.Add(new ListViewItem(new[] { "Great Balls", greatBalls[0].Count.ToString() }));
657 | ballCount += greatBalls[0].Count;
658 | }
659 |
660 | if (ultraBalls.Count > 0)
661 | {
662 | lvBalls.Items.Add(new ListViewItem(new[] { "Ultra Balls", ultraBalls[0].Count.ToString() }));
663 | ballCount += ultraBalls[0].Count;
664 | }
665 | if (masterBalls.Count > 0)
666 | {
667 | lvBalls.Items.Add(new ListViewItem(new[] { "Master Balls", masterBalls[0].Count.ToString() }));
668 | ballCount += masterBalls[0].Count;
669 | }
670 | lblAccountItems.Text = "Account Items - " + ballCount.ToString();
671 | }
672 | catch (Exception ex)
673 | {
674 | MsgError(ex.ToString());
675 | }
676 | }
677 |
678 | private async void refreshPokemonToolStripMenuItem_Click(object sender, EventArgs e)
679 | {
680 | if (bot == null || !bot.running)
681 | {
682 | MsgError("You cannot refresh when the bot is not running...");
683 | return;
684 | }
685 | var items = await bot._inventory.GetItems();
686 |
687 | }
688 |
689 | private async void refreshAllItemsToolStripMenuItem_Click(object sender, EventArgs e)
690 | {
691 | if (bot == null || !bot.running)
692 | {
693 | MsgError("You cannot refresh when the bot is not running...");
694 | return;
695 | }
696 | try
697 | {
698 | lvBalls.Items.Clear();
699 | var items = await bot._inventory.GetItems();
700 | int itemCount = 0;
701 | foreach (var item in items)
702 | {
703 | if (item.Count == 0)
704 | continue;
705 |
706 | try
707 | {
708 | var itemName = item.ItemId;
709 | var procItemName = itemName.ToString().ToNormal();
710 | ListViewItem lvi = new ListViewItem(Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(procItemName.Replace("Item", "").ToLower()));
711 | lvi.SubItems.Add(item.Count.ToString());
712 | lvBalls.Items.Add(lvi);
713 | itemCount += item.Count;
714 | }
715 | catch (InvalidCastException)
716 | {
717 |
718 | }
719 | }
720 | lblAccountItems.Text = "Account Items - " + itemCount.ToString();
721 | }
722 | catch (Exception ex)
723 | {
724 | MsgError(ex.ToString());
725 | }
726 | }
727 |
728 | private async void toolStripMenuItem1_Click(object sender, EventArgs e)
729 | {
730 | if (bot == null || !bot.running)
731 | {
732 | MsgError("You cannot refresh when the bot is not running...");
733 | return;
734 | }
735 | try
736 | {
737 | lvPokemon.Items.Clear();
738 |
739 | var pokemons = await bot._inventory.GetPokemons(false);
740 |
741 | var myPokemonSettings = await bot._inventory.GetPokemonSettings();
742 | var pokemonSettings = myPokemonSettings.ToList();
743 |
744 | var myPokemonFamilies = await bot._inventory.GetPokemonFamilies();
745 | var pokemonFamilies = myPokemonFamilies.ToArray();
746 |
747 | int pokemonCount = 0;
748 |
749 | foreach (var pokemon in pokemons)
750 | {
751 | ListViewItem lvi = new ListViewItem(pokemon.PokemonId.ToString());
752 | lvi.SubItems.Add(pokemon.Cp.ToString());
753 | lvi.SubItems.Add(BotInstance.CalculatePokemonPerfection(pokemon).ToString("0.00"));
754 | lvi.SubItems.Add(pokemon.Stamina.ToString());
755 | lvi.SubItems.Add(pokemon.IndividualStamina.ToString());
756 | lvi.SubItems.Add(pokemon.IndividualAttack.ToString());
757 | lvi.SubItems.Add(pokemon.IndividualDefense.ToString());
758 | lvi.SubItems.Add((pokemon.IndividualAttack + pokemon.IndividualDefense + pokemon.IndividualStamina).ToString());
759 |
760 | int[] candy = await bot._inventory.GetRequiredCandy(pokemonSettings, pokemonFamilies, pokemon.PokemonId);
761 | if (candy[1] == 0) // fully evolved
762 | lvi.SubItems.Add(string.Format("0", candy[0], candy[1]));
763 | else
764 | lvi.SubItems.Add(string.Format("{0}/{1}", candy[0], candy[1]));
765 | lvi.Tag = pokemon; // set as tag
766 | lvPokemon.Items.Add(lvi);
767 | pokemonCount++;
768 | }
769 |
770 | lblPokemon.Text = "Account Pokemon - " + pokemonCount;
771 | }
772 | catch (Exception ex)
773 | {
774 | MsgError(ex.ToString());
775 | }
776 |
777 | }
778 |
779 | private void uncheckAllToolStripMenuItem_Click(object sender, EventArgs e)
780 | {
781 | // Try to cast the sender to a MenuItem
782 | ToolStripMenuItem menuItem = sender as ToolStripMenuItem;
783 | if (menuItem == null)
784 | return;
785 | ContextMenuStrip menu = menuItem.Owner as ContextMenuStrip;
786 | CheckedListBox sourceControl = (CheckedListBox)menu.SourceControl;
787 | if (sourceControl == null)
788 | return;
789 |
790 | for (int i = 0; i < sourceControl.Items.Count; i++)
791 | sourceControl.SetItemChecked(i, false);
792 | }
793 |
794 | private async void evolveSelectedToolStripMenuItem_Click(object sender, EventArgs e)
795 | {
796 | if (bot == null || !bot.running)
797 | {
798 | MsgError("You cannot evolve when the bot is not running...");
799 | return;
800 | }
801 |
802 | try
803 | {
804 |
805 | var myPokemonSettings = await bot._inventory.GetPokemonSettings();
806 | var pokemonSettings = myPokemonSettings.ToList();
807 |
808 | var myPokemonFamilies = await bot._inventory.GetPokemonFamilies();
809 | var pokemonFamilies = myPokemonFamilies.ToArray();
810 |
811 | foreach (ListViewItem lvi in lvPokemon.SelectedItems)
812 | {
813 | try
814 | {
815 | PokemonData pd = lvi.Tag as PokemonData;
816 |
817 | int[] candy = await bot._inventory.GetRequiredCandy(pokemonSettings, pokemonFamilies, pd.PokemonId);
818 |
819 | if (candy[0] < candy[1])
820 | {
821 | Logger.Write($"Skipped {pd.PokemonId} because it only had {candy[0]} out of {candy[1]} required candies");
822 | continue;
823 | }
824 | var res = await bot._client.Inventory.EvolvePokemon(pd.Id);
825 |
826 | if (res.Result == POGOProtos.Networking.Responses.EvolvePokemonResponse.Types.Result.Success)
827 | {
828 | Logger.Write($"Evolved {pd.PokemonId} successfully for {res.ExperienceAwarded}xp", LogLevel.Info, ConsoleColor.DarkGreen);
829 | bot._stats.increasePokemonsTransfered();
830 | bot._stats.updateConsoleTitle(bot._inventory);
831 | }
832 | else
833 | {
834 | Logger.Write($"Failed to evolve {pd.PokemonId}. EvolvePokemonOutProto.Result was {res.Result}, stopped evolving {pd.PokemonId}", LogLevel.Info);
835 | }
836 | }
837 | catch (Exception ex)
838 | {
839 | Logger.Write($"Exception (evolving from AD): {ex}");
840 | }
841 | }
842 | toolStripMenuItem1_Click(null, null);
843 | }
844 | catch (Exception ex)
845 | {
846 | MsgError(ex.ToString());
847 | }
848 | }
849 |
850 | private async void transferSelectedToolStripMenuItem_Click(object sender, EventArgs e)
851 | {
852 | if (bot == null || !bot.running)
853 | {
854 | MsgError("You cannot transfer when the bot is not running...");
855 | return;
856 | }
857 |
858 | try
859 | {
860 | foreach (ListViewItem lvi in lvPokemon.SelectedItems)
861 | {
862 | try
863 | {
864 | PokemonData pd = lvi.Tag as PokemonData;
865 |
866 | var res = await bot._client.Inventory.TransferPokemon(pd.Id);
867 |
868 | Logger.Write($"Transferred {pd.PokemonId} with {pd.Cp} CP", LogLevel.Info, ConsoleColor.Yellow);
869 | bot._stats.increasePokemonsTransfered();
870 | bot._stats.updateConsoleTitle(bot._inventory);
871 | }
872 | catch (Exception ex)
873 | {
874 | Logger.Write($"Exception (transfer from AD): {ex}");
875 | }
876 | }
877 | toolStripMenuItem1_Click(null, null);
878 | }
879 | catch (Exception ex)
880 | {
881 | MsgError(ex.ToString());
882 | }
883 | }
884 |
885 | private void btnActivateLuckyEgg_Click(object sender, EventArgs e)
886 | {
887 | if (bot == null || !bot.running)
888 | {
889 | MsgError("You cannot activate a Lucky Egg when the bot is not running...");
890 | return;
891 | }
892 |
893 | new Task(async () =>
894 | {
895 | var resp = await bot.UseLuckyEgg();
896 | if (resp == POGOProtos.Networking.Responses.UseItemXpBoostResponse.Types.Result.Success)
897 | {
898 | MsgInfo("Used Lucky Egg!");
899 | }
900 | else if (resp == POGOProtos.Networking.Responses.UseItemXpBoostResponse.Types.Result.ErrorXpBoostAlreadyActive)
901 | {
902 | MsgError("You already have a Lucky Egg active!");
903 | }
904 | else
905 | {
906 | MsgError("Failed to use a Lucky Egg, make sure you have some left!");
907 | }
908 | }).Start();
909 |
910 | }
911 | }
912 | }
913 |
--------------------------------------------------------------------------------
/GoBot/GoBot.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {3151326F-7BBE-4EC1-BEF3-61DA43A98E01}
8 | WinExe
9 | Properties
10 | GoBot
11 | GoBot
12 | v4.6.1
13 | 512
14 | true
15 |
16 | publish\
17 | true
18 | Disk
19 | false
20 | Foreground
21 | 7
22 | Days
23 | false
24 | false
25 | true
26 | 0
27 | 1.0.0.%2a
28 | false
29 | false
30 | true
31 |
32 |
33 | AnyCPU
34 | true
35 | full
36 | false
37 | bin\Debug\
38 | DEBUG;TRACE
39 | prompt
40 | 4
41 |
42 |
43 | AnyCPU
44 | pdbonly
45 | true
46 | bin\Release\
47 | TRACE
48 | prompt
49 | 4
50 |
51 |
52 | go.ico
53 |
54 |
55 |
56 | False
57 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\C5.dll
58 |
59 |
60 | ..\packages\GMap.NET.WindowsForms.1.7.1\lib\net40\GMap.NET.Core.dll
61 | True
62 |
63 |
64 | ..\packages\GMap.NET.WindowsForms.1.7.1\lib\net40\GMap.NET.WindowsForms.dll
65 | True
66 |
67 |
68 | False
69 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\Google.Protobuf.dll
70 |
71 |
72 | ..\packages\GoogleMapsApi.0.56.0\lib\net45\GoogleMapsApi.dll
73 | True
74 |
75 |
76 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.dll
77 |
78 |
79 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.Data.dll
80 |
81 |
82 | False
83 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\Newtonsoft.Json.dll
84 |
85 |
86 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\POGOProtos.dll
87 |
88 |
89 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\Pokemon.Go.Rocket.API.dll
90 |
91 |
92 | False
93 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\S2Geometry.dll
94 |
95 |
96 |
97 |
98 | False
99 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\System.Net.Http.Formatting.dll
100 |
101 |
102 | False
103 | ..\..\..\..\GitHub\Pokemon-Go-Rocket-API\PokemonGo.RocketAPI\bin\Debug\System.VarintBitConverter.dll
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | True
120 | True
121 | Resources.resx
122 |
123 |
124 |
125 |
126 |
127 | Form
128 |
129 |
130 | FrmMain.cs
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 | FrmMain.cs
148 |
149 |
150 | ResXFileCodeGenerator
151 | Designer
152 | Resources.Designer.cs
153 |
154 |
155 |
156 | SettingsSingleFileGenerator
157 | Settings.Designer.cs
158 |
159 |
160 | True
161 | Settings.settings
162 | True
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 | False
178 | .NET Framework 3.5 SP1
179 | false
180 |
181 |
182 |
183 |
190 |
--------------------------------------------------------------------------------
/GoBot/GoBot.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | publish\
5 |
6 |
7 |
8 |
9 |
10 | en-US
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/GoBot/ListViewColumnSorter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Windows.Forms;
3 | using System;
4 |
5 | class Sorter : System.Collections.IComparer
6 | {
7 | public int Column = 0;
8 | public System.Windows.Forms.SortOrder Order = SortOrder.Ascending;
9 | public int Compare(object x, object y) // IComparer Member
10 | {
11 | if (!(x is ListViewItem))
12 | return (0);
13 | if (!(y is ListViewItem))
14 | return (0);
15 |
16 | ListViewItem l1 = (ListViewItem)x;
17 | ListViewItem l2 = (ListViewItem)y;
18 |
19 | if (l1.ListView.Columns[Column].Tag == null)
20 | {
21 | l1.ListView.Columns[Column].Tag = "Text";
22 | }
23 |
24 | if (l1.ListView.Columns[Column].Tag.ToString() == "Numeric")
25 | {
26 | if (string.IsNullOrEmpty(l1.SubItems[Column].Text) || string.IsNullOrEmpty(l2.SubItems[Column].Text))
27 | return 0;
28 | try
29 | {
30 | float fl1 = 0;
31 | float fl2 = 0;
32 |
33 |
34 | if (l1.SubItems[Column].Text.Contains("/"))
35 | {
36 | fl1 = float.Parse(l1.SubItems[Column].Text.Split('/')[0]);
37 | }
38 | else
39 | {
40 | fl1 = float.Parse(l1.SubItems[Column].Text);
41 | }
42 |
43 | if (l2.SubItems[Column].Text.Contains("/"))
44 | {
45 | fl2 = float.Parse(l2.SubItems[Column].Text.Split('/')[0]);
46 | }
47 | else
48 | {
49 | fl2 = float.Parse(l2.SubItems[Column].Text);
50 | }
51 |
52 | if (Order == SortOrder.Ascending)
53 | {
54 | return fl1.CompareTo(fl2);
55 | }
56 | else
57 | {
58 | return fl2.CompareTo(fl1);
59 | }
60 | }
61 | catch (Exception)
62 | {
63 | return 0;
64 | }
65 | }
66 | else
67 | {
68 | string str1 = l1.SubItems[Column].Text;
69 | string str2 = l2.SubItems[Column].Text;
70 |
71 | if (Order == SortOrder.Ascending)
72 | {
73 | return str1.CompareTo(str2);
74 | }
75 | else
76 | {
77 | return str2.CompareTo(str1);
78 | }
79 | }
80 | }
81 | }
--------------------------------------------------------------------------------
/GoBot/Logic/Actions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace GoBot
8 | {
9 | class Actions
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/GoBot/Logic/BotInstance.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using GoBot.UserLogger;
4 | using GoBot.Utils;
5 | using POGOProtos.Data;
6 | using POGOProtos.Enums;
7 | using POGOProtos.Inventory;
8 | using POGOProtos.Inventory.Item;
9 | using POGOProtos.Map.Fort;
10 | using POGOProtos.Map.Pokemon;
11 | using POGOProtos.Networking.Responses;
12 | using PokemonGo.RocketAPI;
13 | using PokemonGo.RocketAPI.Enums;
14 | using PokemonGo.RocketAPI.Exceptions;
15 | using PokemonGo.RocketAPI.Extensions;
16 |
17 | using PokemonGo.RocketAPI.Login;
18 | using System;
19 | using System.Collections.Generic;
20 | using System.Linq;
21 | using System.Threading.Tasks;
22 |
23 | namespace GoBot.Logic
24 | {
25 | public class BotInstance
26 | {
27 | public readonly Client _client;
28 | public readonly ISettings _clientSettings;
29 | public readonly Inventory _inventory;
30 | public readonly Navigation _navigation;
31 |
32 | public Statistics _stats;
33 |
34 | public List TransferList;
35 | public List EvolveList;
36 | public List CatchList;
37 | public List BerryList;
38 |
39 | public List VisitedForts = new List();
40 |
41 | public bool running = false;
42 | public bool restarting = false;
43 |
44 | public Random rand = new Random();
45 |
46 | public BotInstance(ISettings clientSettings)
47 | {
48 |
49 | _clientSettings = clientSettings;
50 | _client = new Client(_clientSettings);
51 | _inventory = new Inventory(_client);
52 | _navigation = new Navigation(_client, this);
53 | _stats = new Statistics();
54 | Events.OnStepWalked += Events_OnStepWalked;
55 | }
56 |
57 | private async void Login_OnRelogRequiredEvent(Client client, int errorCount)
58 | {
59 | Logger.Write($"Relog Requested error count was {errorCount}", LogLevel.Error, ConsoleColor.Magenta);
60 | // login... messy
61 | if (!await Login())
62 | {
63 | Logger.Write($"Invalid email/username or password for Google/Ptc Authentication!");
64 | running = false;
65 |
66 | }
67 | }
68 |
69 | private async void Events_OnStepWalked(object sender, StepWalkedArgs e)
70 | {
71 | if (!UserSettings.CatchPokemonOnWalk)
72 | {
73 | Events.StepWalkedReset.Set();
74 | return;
75 | }
76 | try
77 | {
78 | await ExecuteCatchAllNearbyPokemons(true);
79 |
80 | if (_client.CurrentLatitude != e.curLocation.Latitude && _client.CurrentLongitude != e.curLocation.Longitude)
81 | {
82 | Logger.Write("Walking back to initial route...");
83 | // only if they have moved
84 | if (UserSettings.TeleportToPokemonOnWalk)
85 | {
86 | var update = await _client.Player.UpdatePlayerLocation(e.curLocation.Latitude, e.curLocation.Longitude, UserSettings.Altitude);
87 | }
88 | else
89 | {
90 | var update = await _navigation.HumanLikeWalking(e.curLocation, UserSettings.WalkingSpeed, true, true);
91 | }
92 |
93 | }
94 | }
95 | catch (InvalidResponseException)
96 | {
97 | /*Logger.Write("Invalid packet was received. Please wait for the bot to reset, we'll keep your last known coordinates to update to the server!");
98 | UserSettings.StartLat = _client.CurrentLatitude;
99 | UserSettings.StartLng = _client.CurrentLongitude;
100 | UserSettings.Altitude = _client.CurrentAltitude;*/
101 |
102 | restarting = true;
103 |
104 | }
105 | catch (Exception ex)
106 | {
107 | Logger.Write($"Exception on Step Walked: {ex}", LogLevel.Error, ConsoleColor.Red);
108 | }
109 | Events.StepWalkedReset.Set();
110 |
111 | }
112 |
113 | public void Stop()
114 | {
115 | running = false;
116 | Logger.Write("Stop was called!");
117 | }
118 |
119 | public async Task Execute()
120 | {
121 | Logger.Write($"Starting Execute on login server: {_clientSettings.AuthType}", LogLevel.Info, ConsoleColor.Magenta);
122 | running = true;
123 | while (running)
124 | {
125 | try
126 | {
127 | /*if (await Login())
128 | {
129 | running = true;
130 |
131 | await PostLoginExecute();
132 |
133 | running = true;
134 | }
135 | else
136 | {
137 | running = false;
138 | break;
139 | }*/
140 |
141 |
142 | await PostLoginExecute();
143 | }
144 | catch (Exception ex)
145 | {
146 | Logger.Write($"Execute Exception: {ex}", LogLevel.Info, ConsoleColor.Red);
147 |
148 | }
149 | Logger.Write($"Looping Execute Again", LogLevel.Info);
150 | await T.Delay(rand.Next(8000, 15000));
151 | }
152 | }
153 |
154 | private void Login_GoogleDeviceCodeEvent(string code, string uri)
155 | {
156 |
157 | Logger.Write($"Your Google Device Code is {code} enter it at {uri}", LogLevel.Info, ConsoleColor.White);
158 |
159 | Logger.Write("Once entered, please wait for the bot to start...", LogLevel.Info, ConsoleColor.White);
160 |
161 |
162 | }
163 |
164 | public async Task Login()
165 | {
166 | try
167 | {
168 | if (_clientSettings.AuthType == AuthType.Ptc)
169 | await _client.Login.DoPtcLogin(UserSettings.Username, UserSettings.Password);
170 | else if (_clientSettings.AuthType == AuthType.Google)
171 | {
172 | await _client.Login.DoGoogleLogin(UserSettings.Username, UserSettings.Password);
173 | }
174 |
175 | return true;
176 | }
177 | catch (Exception ex)
178 | {
179 | Logger.Write($"Login Exception: {ex}", LogLevel.Info, ConsoleColor.Red);
180 | }
181 | return false;
182 | }
183 | public async Task PostLoginExecute()
184 | {
185 | while (running)
186 | {
187 | // login... messy
188 | if (!await Login())
189 | {
190 | Logger.Write($"Invalid email/username or password for Google/Ptc Authentication!");
191 | running = false;
192 | break;
193 | }
194 |
195 | try
196 | {
197 | if (!UserSettings.CatchPokemon && !UserSettings.GetForts)
198 | {
199 | // idle instead and clean/evolve/whatever.
200 | // set server is done in ptclogin/googlelogin
201 | await EvolveAllPokemonWithEnoughCandy();
202 | await RecycleItems();
203 | await TransferDuplicatePokemon(UserSettings.KeepCP, false);
204 | }
205 | else
206 | {
207 |
208 | await EvolveAllPokemonWithEnoughCandy();
209 | await RecycleItems();
210 | await TransferDuplicatePokemon(UserSettings.KeepCP, false);
211 |
212 |
213 | await ExecuteFarmingForts(UserSettings.CatchPokemon);
214 | }
215 |
216 | }
217 | catch (InvalidResponseException)
218 | {
219 | Logger.Write("Invalid packet was received. Please wait for the bot to reset, we'll keep your last known coordinates to update to the server!");
220 | UserSettings.StartLat = _client.CurrentLatitude;
221 | UserSettings.StartLng = _client.CurrentLongitude;
222 | UserSettings.Altitude = _client.CurrentAltitude;
223 |
224 |
225 | await Task.Delay(5000);
226 | }
227 | catch (AccessTokenExpiredException)
228 | {
229 | Logger.Write("Access token was expired", LogLevel.Error, ConsoleColor.Red);
230 | throw;
231 | }
232 | catch (Exception ex)
233 | {
234 | Logger.Write($"Exception (PostLogin): {ex}", LogLevel.Error, ConsoleColor.Red);
235 | }
236 |
237 | await T.Delay(rand.Next(8000, 15000));
238 | Logger.Write($"Looping PostLogin Again - Idle: {!UserSettings.CatchPokemon && !UserSettings.GetForts}", LogLevel.Info);
239 | Logger.Write($"If this is happening a lot it means the Pokemon servers are unstable, do not spam issues on git with this! We can't fix it!", LogLevel.Info);
240 | }
241 | Logger.Write($"We're out of the loop now, Running is {running}");
242 | // walk home
243 | try
244 | {
245 | await WalkToStart();
246 | }
247 | catch (Exception ex)
248 | {
249 | Logger.Write($"Exception: {ex}", LogLevel.Error, ConsoleColor.Red);
250 | }
251 | }
252 |
253 | public async Task WalkToStart()
254 | {
255 | Logger.Write("Stopping and walking to start point...");
256 | var update = await _navigation.DirectionalWalking(new Navigation.Location(_clientSettings.DefaultLatitude, _clientSettings.DefaultLongitude), UserSettings.WalkingSpeed);//await _navigation.HumanLikeWalking(new Navigation.Location(_clientSettings.DefaultLatitude, _clientSettings.DefaultLongitude), UserSettings.WalkingSpeed);
257 | Logger.Write("Bot has been stopped and has reached the start point used. You may now safely exit.");
258 | }
259 | public async Task ExecuteFarmingForts(bool getPokes)
260 | {
261 | var mapObjects = await _client.Map.GetMapObjects();
262 |
263 | var pokeStops = mapObjects.MapCells.SelectMany(i => i.Forts).Where(i => i.Type == FortType.Checkpoint && i.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime()).OrderBy(i => LocationUtils.CalculateDistanceInMeters(new Navigation.Location(_client.CurrentLatitude, _client.CurrentLongitude), new Navigation.Location(i.Latitude, i.Longitude)));
264 |
265 | if (UserSettings.NoDupeForts)
266 | pokeStops = pokeStops.Where(i => !VisitedForts.Contains(i)).OrderBy(i => LocationUtils.CalculateDistanceInMeters(new Navigation.Location(_client.CurrentLatitude, _client.CurrentLongitude), new Navigation.Location(i.Latitude, i.Longitude)));
267 |
268 | if (pokeStops.ToList().Count == 0)
269 | {
270 | VisitedForts.Clear();
271 | }
272 |
273 |
274 | Logger.Write($"Farming {pokeStops.ToList().Count} PokeStops... {running}", LogLevel.Info, ConsoleColor.Cyan);
275 | foreach (var pokeStop in pokeStops)
276 | {
277 |
278 | if (!running)
279 | break;
280 | /*if (UserSettings.Teleport)
281 | {
282 | // You'll be banned, I warned you...
283 | var dist = LocationUtils.CalculateDistanceInMeters(new Navigation.Location(_client.CurrentLatitude, _client.CurrentLongitude), new Navigation.Location(pokemon.Latitude, pokemon.Longitude));
284 | var update = await _client.Player.UpdatePlayerLocation(pokeStop.Latitude, pokeStop.Longitude, UserSettings.Altitude);
285 | }
286 | else
287 | {*/
288 | var update =
289 | await _navigation.DirectionalWalking(new Navigation.Location(pokeStop.Latitude, pokeStop.Longitude), UserSettings.WalkingSpeed);
290 | //}
291 |
292 | if (UserSettings.GetForts)
293 | {
294 | //var fortInfo = await client.GetFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
295 | var fortSearch = await _client.Fort.SearchFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
296 |
297 | VisitedForts.Add(pokeStop);
298 |
299 | _stats.addExperience(fortSearch.ExperienceAwarded);
300 | _stats.updateConsoleTitle(_inventory);
301 |
302 |
303 |
304 | await Events.FortFarmed(fortSearch, pokeStop);
305 |
306 |
307 | Logger.Write($"Farmed XP: {fortSearch.ExperienceAwarded}, Gems: { fortSearch.GemsAwarded}, Eggs: {fortSearch.PokemonDataEgg} Items: {StringUtils.GetSummedFriendlyNameOfItemAwardList(fortSearch.ItemsAwarded)}", LogLevel.Info, ConsoleColor.Cyan);
308 | await T.Delay(rand.Next(3000, 6000));
309 | }
310 |
311 | var profile = await _client.Player.GetPlayer();
312 | _stats.getStardust(profile.PlayerData.Currencies.ToArray()[1].Amount);
313 | _stats.updateConsoleTitle(_inventory);
314 |
315 | if (getPokes)
316 | await ExecuteCatchAllNearbyPokemons();
317 |
318 | await T.Delay(15000);
319 | }
320 | }
321 |
322 | private async Task ExecuteCatchAllNearbyPokemons(bool fromWalking = false)
323 | {
324 | var mapObjects = await _client.Map.GetMapObjects();
325 |
326 | var catchPokemons = mapObjects.MapCells.SelectMany(i => i.CatchablePokemons).OrderBy(i => LocationUtils.CalculateDistanceInMeters(new Navigation.Location(_client.CurrentLatitude, _client.CurrentLongitude), new Navigation.Location(i.Latitude, i.Longitude)));
327 | //var nearPokemons = mapObjects.MapCells.SelectMany(i => i.NearbyPokemons).OrderBy(i => i.DistanceInMeters);
328 | //var wildPokemons = mapObjects.MapCells.SelectMany(i => i.WildPokemons).OrderBy(i => LocationUtils.CalculateDistanceInMeters(new Navigation.Location(_client.CurrentLatitude, _client.CurrentLongitude), new Navigation.Location(i.Latitude, i.Longitude)));
329 |
330 | Logger.Write($"Catching {catchPokemons.ToList().Count} nearby Pokemon", LogLevel.Info, ConsoleColor.Magenta);
331 |
332 | foreach (var pokemon in catchPokemons)
333 | {
334 | if (!running)
335 | break;
336 | try
337 | {
338 | // we'll teleport if we're on the walk? I don't think that'd be wise
339 | var dist = LocationUtils.CalculateDistanceInMeters(new Navigation.Location(_client.CurrentLatitude, _client.CurrentLongitude), new Navigation.Location(pokemon.Latitude, pokemon.Longitude));
340 | if (UserSettings.Teleport || (fromWalking && UserSettings.TeleportToPokemonOnWalk))
341 | {
342 |
343 | if (dist > UserSettings.CatchWalkRadius && fromWalking)
344 | {
345 | Logger.Write($"Did not catch pokemon due to it being >{UserSettings.CatchWalkRadius} meters from the pokestop route!");
346 | continue;
347 | }
348 | await Task.Delay(dist > 100 ? 5000 : 500);
349 | var update = await _client.Player.UpdatePlayerLocation(pokemon.Latitude, pokemon.Longitude, UserSettings.Altitude);
350 | }
351 | else
352 | {
353 | if (dist > UserSettings.CatchWalkRadius && fromWalking)
354 | {
355 | Logger.Write($"Did not catch pokemon due to it being >{UserSettings.CatchWalkRadius} meters from the pokestop route!");
356 | continue;
357 | }
358 | var update = await _navigation.DirectionalWalking(new Navigation.Location(pokemon.Latitude, pokemon.Longitude), UserSettings.WalkingSpeed, true);
359 | }
360 |
361 | var encounter = await _client.Encounter.EncounterPokemon(pokemon.EncounterId, pokemon.SpawnPointId);
362 |
363 | if (encounter.Status == EncounterResponse.Types.Status.EncounterSuccess)
364 | {
365 | var pokeId = encounter?.WildPokemon?.PokemonData.PokemonId;
366 | await CatchEncounter(encounter, pokemon);
367 | }
368 |
369 |
370 | await T.Delay(rand.Next(15000, 30000));
371 | }
372 | catch (Exception ex)
373 | {
374 | Logger.Write($"Exception Catch MapPokemon: {ex}", LogLevel.Error, ConsoleColor.Red);
375 | }
376 | }
377 | }
378 |
379 |
380 | private async Task CatchEncounter(EncounterResponse encounter, MapPokemon pokemon)
381 | {
382 |
383 | CatchPokemonResponse caughtPokemonResponse;
384 | do
385 | {
386 | try
387 | {
388 | PokemonData pokeData = encounter?.WildPokemon?.PokemonData;
389 |
390 | if (encounter?.CaptureProbability != null && encounter?.CaptureProbability.CaptureProbability_.First() < (UserSettings.BerryProbability / 100))
391 | {
392 | if (pokeData != null)
393 | {
394 | if (BerryList.Contains(pokeData.PokemonId))
395 | {
396 | await UseBerry(pokemon.EncounterId, pokemon.SpawnPointId);
397 | }
398 | }
399 |
400 |
401 | }
402 |
403 | var pokeball = await GetBestBall(encounter?.WildPokemon);
404 |
405 | if (pokeball == ItemId.ItemUnknown)
406 | {
407 | Logger.Write("No Pokeballs to use! STOPPING BOT!", LogLevel.Error, ConsoleColor.Red);
408 | Stop();
409 | return;
410 | }
411 | caughtPokemonResponse = await _client.Encounter.CatchPokemon(pokemon.EncounterId, pokemon.SpawnPointId, pokeball);
412 |
413 | Logger.Write(caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess ? $"We caught a {pokemon.PokemonId} with CP {encounter?.WildPokemon?.PokemonData?.Cp} ({CalculatePokemonPerfection(encounter?.WildPokemon?.PokemonData).ToString("0.00")}% perfection) using a {pokeball}" : $"{pokemon.PokemonId} with CP {encounter?.WildPokemon?.PokemonData?.Cp} got away while using a {pokeball}..", LogLevel.Info, ConsoleColor.Green);
414 |
415 | if (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess)
416 | {
417 | pokeData = encounter?.WildPokemon?.PokemonData;
418 |
419 | foreach (int xp in caughtPokemonResponse.CaptureAward.Xp)
420 | _stats.addExperience(xp);
421 |
422 | var profile = await _client.Player.GetPlayer();
423 | _stats.getStardust(profile.PlayerData.Currencies.ToArray()[1].Amount);
424 |
425 | _stats.increasePokemons();
426 | _stats.updateConsoleTitle(_inventory);
427 | await Events.PokemonCaught(encounter?.WildPokemon?.PokemonData, caughtPokemonResponse.CapturedPokemonId);
428 | }
429 |
430 | await T.Delay(rand.Next(1500, 3000));
431 | }
432 | catch (Exception ex)
433 | {
434 | Logger.Write($"Exception in Encounter: {ex}", LogLevel.Error, ConsoleColor.Red);
435 | break;
436 | }
437 | }
438 | while (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchMissed);
439 | }
440 |
441 | private async Task GetBestBall(WildPokemon pokemon)
442 | {
443 | var pokemonCp = pokemon?.PokemonData?.Cp;
444 |
445 | var items = await _inventory.GetItems();
446 | var balls = items.Where(i => (i.ItemId == ItemId.ItemPokeBall
447 | || i.ItemId == ItemId.ItemGreatBall
448 | || i.ItemId == ItemId.ItemUltraBall
449 | || i.ItemId == ItemId.ItemMasterBall) && i.Count > 0).GroupBy(i => (i.ItemId)).ToList();
450 | if (balls.Count == 0) return ItemId.ItemUnknown;
451 |
452 | var pokeBalls = balls.Any(g => g.Key == ItemId.ItemPokeBall);
453 | var greatBalls = balls.Any(g => g.Key == ItemId.ItemGreatBall);
454 | var ultraBalls = balls.Any(g => g.Key == ItemId.ItemUltraBall);
455 | var masterBalls = balls.Any(g => g.Key == ItemId.ItemMasterBall);
456 |
457 | if (masterBalls && pokemonCp >= 2000)
458 | return ItemId.ItemMasterBall;
459 | else if (ultraBalls && pokemonCp >= 2000)
460 | return ItemId.ItemUltraBall;
461 | else if (greatBalls && pokemonCp >= 2000)
462 | return ItemId.ItemGreatBall;
463 |
464 | if (ultraBalls && pokemonCp >= 1000)
465 | return ItemId.ItemUltraBall;
466 | else if (greatBalls && pokemonCp >= 1000)
467 | return ItemId.ItemGreatBall;
468 |
469 | if (greatBalls && pokemonCp >= 500)
470 | return ItemId.ItemGreatBall;
471 |
472 | return balls.OrderBy(g => g.Key).First().Key;
473 | }
474 | private async Task GetBestBerry(WildPokemon pokemon)
475 | {
476 | var pokemonCp = pokemon?.PokemonData?.Cp;
477 |
478 | var items = await _inventory.GetItems();
479 | var berries = items.Where(i => i.ItemId == ItemId.ItemRazzBerry
480 | || i.ItemId == ItemId.ItemBlukBerry
481 | || i.ItemId == ItemId.ItemNanabBerry
482 | || i.ItemId == ItemId.ItemWeparBerry
483 | || i.ItemId == ItemId.ItemPinapBerry).GroupBy(i => (i.ItemId)).ToList();
484 | if (berries.Count == 0 || pokemonCp <= 350) return ItemId.ItemUnknown;
485 |
486 | var razzBerryCount = await _inventory.GetItemAmountByType(ItemId.ItemRazzBerry);
487 | var blukBerryCount = await _inventory.GetItemAmountByType(ItemId.ItemBlukBerry);
488 | var nanabBerryCount = await _inventory.GetItemAmountByType(ItemId.ItemNanabBerry);
489 | var weparBerryCount = await _inventory.GetItemAmountByType(ItemId.ItemWeparBerry);
490 | var pinapBerryCount = await _inventory.GetItemAmountByType(ItemId.ItemPinapBerry);
491 |
492 | if (pinapBerryCount > 0 && pokemonCp >= 2000)
493 | return ItemId.ItemPinapBerry;
494 | else if (weparBerryCount > 0 && pokemonCp >= 2000)
495 | return ItemId.ItemWeparBerry;
496 | else if (nanabBerryCount > 0 && pokemonCp >= 2000)
497 | return ItemId.ItemNanabBerry;
498 | else if (nanabBerryCount > 0 && pokemonCp >= 2000)
499 | return ItemId.ItemBlukBerry;
500 |
501 | if (weparBerryCount > 0 && pokemonCp >= 1500)
502 | return ItemId.ItemWeparBerry;
503 | else if (nanabBerryCount > 0 && pokemonCp >= 1500)
504 | return ItemId.ItemNanabBerry;
505 | else if (blukBerryCount > 0 && pokemonCp >= 1500)
506 | return ItemId.ItemBlukBerry;
507 |
508 | if (nanabBerryCount > 0 && pokemonCp >= 1000)
509 | return ItemId.ItemNanabBerry;
510 | else if (blukBerryCount > 0 && pokemonCp >= 1000)
511 | return ItemId.ItemBlukBerry;
512 |
513 | if (blukBerryCount > 0 && pokemonCp >= 500)
514 | return ItemId.ItemBlukBerry;
515 |
516 | return berries.OrderBy(g => g.Key).First().Key;
517 | }
518 | public async Task UseBerry(ulong encounterId, string spawnPointId)
519 | {
520 | if (!UserSettings.UseBerries)
521 | return;
522 |
523 | var inventoryBalls = await _inventory.GetItems();
524 | var berries = inventoryBalls.Where(p => (ItemId)p.ItemId == ItemId.ItemRazzBerry);
525 | var berry = berries.FirstOrDefault();
526 |
527 | if (berry == null)
528 | return;
529 |
530 | var useRaspberry = await _client.Encounter.UseCaptureItem(encounterId, ItemId.ItemRazzBerry, spawnPointId);
531 | Logger.Write($"Use Rasperry. Remaining: {berry.Count}", LogLevel.Info);
532 | await T.Delay(rand.Next(4000, 8000));
533 | }
534 | public static float CalculatePokemonPerfection(PokemonData poke)
535 | {
536 | return ((float)(poke.IndividualAttack * 2 + poke.IndividualDefense + poke.IndividualStamina) / (4.0f * 15.0f)) * 100.0f;
537 | }
538 | public async Task EvolveAllPokemonWithEnoughCandy()
539 | {
540 | var pokemonToEvolve = await _inventory.GetPokemonToEvolve();
541 | Logger.Write($"Sorting through {pokemonToEvolve.ToList().Count} pokemon to evolve...", LogLevel.Info, ConsoleColor.DarkGreen);
542 |
543 | foreach (var pokemon in pokemonToEvolve)
544 | {
545 | if (!EvolveList.Contains(pokemon.PokemonId))
546 | continue;
547 |
548 | if (pokemon.Cp < UserSettings.EvolveOverCP && CalculatePokemonPerfection(pokemon) < UserSettings.EvolveOverIV)
549 | {
550 | Logger.Write($"Did not Evolve {pokemon.PokemonId} ({pokemon.Cp} cp, {CalculatePokemonPerfection(pokemon).ToString("0.00")}%) (Under Requirement) ", LogLevel.Info);
551 |
552 | continue;
553 | }
554 |
555 | var evolvePokemonOutProto = await _client.Inventory.EvolvePokemon((ulong)pokemon.Id);
556 | _stats.increasePokemonsTransfered();
557 | _stats.updateConsoleTitle(_inventory);
558 | if (evolvePokemonOutProto.Result == EvolvePokemonResponse.Types.Result.Success)
559 | Logger.Write($"Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExperienceAwarded}xp", LogLevel.Info, ConsoleColor.DarkGreen);
560 | else
561 | Logger.Write($"Failed to evolve {pokemon.PokemonId}. EvolvePokemonOutProto.Result was {evolvePokemonOutProto.Result}, stopping evolving {pokemon.PokemonId}", LogLevel.Info);
562 |
563 |
564 | await T.Delay(rand.Next(3000, 5000));
565 | }
566 | }
567 |
568 | public async Task TransferDuplicatePokemon(int keepCp, bool keepPokemonsThatCanEvolve = false)
569 | {
570 |
571 | var duplicatePokemons = await _inventory.GetDuplicatePokemonToTransfer(keepCp, keepPokemonsThatCanEvolve);
572 |
573 | Logger.Write($"Sorting through {duplicatePokemons.ToList().Count} pokemon to transfer duplicates...", LogLevel.Info, ConsoleColor.Yellow);
574 |
575 | foreach (var duplicatePokemon in duplicatePokemons)
576 | {
577 | // stop transfer of pokemon that are not on transfer list
578 | if (!TransferList.Contains(duplicatePokemon.PokemonId))
579 | continue;
580 |
581 | if (duplicatePokemon.Cp > UserSettings.KeepCP || CalculatePokemonPerfection(duplicatePokemon) > UserSettings.KeepIV)
582 | {
583 | Logger.Write($"Did not Transfer {duplicatePokemon.PokemonId} ({duplicatePokemon.Cp} cp, {CalculatePokemonPerfection(duplicatePokemon).ToString("0.00")}%) (Over Requirement) ", LogLevel.Info);
584 | continue;
585 | }
586 |
587 | var transfer = await _client.Inventory.TransferPokemon(duplicatePokemon.Id);
588 | _stats.increasePokemonsTransfered();
589 | _stats.updateConsoleTitle(_inventory);
590 | Logger.Write($"Transferred {duplicatePokemon.PokemonId} with {duplicatePokemon.Cp} CP", LogLevel.Info, ConsoleColor.Yellow);
591 | await T.Delay(rand.Next(3000, 6000));
592 | }
593 | }
594 |
595 | public async Task TransferPokemonFromList()
596 | {
597 | var pokemons = await _inventory.GetPokemons();
598 | var pokemonList = pokemons as IList ?? pokemons.ToList();
599 |
600 | // UNTESTED
601 | foreach (var pokemon in pokemonList.Where(x => x.Favorite == 0).OrderByDescending(i=> i.Cp).ThenBy(i => i.StaminaMax))
602 | {
603 | if (!TransferList.Contains(pokemon.PokemonId))
604 | continue;
605 | if (pokemon.Cp > UserSettings.KeepCP || CalculatePokemonPerfection(pokemon) > UserSettings.KeepIV)
606 | {
607 | Logger.Write($"Did not Transfer {pokemon.PokemonId} ({pokemon.Cp} cp, {CalculatePokemonPerfection(pokemon).ToString("0.00")}%) (Over Requirement) ", LogLevel.Info);
608 | continue;
609 | }
610 | var transfer = await _client.Inventory.TransferPokemon(pokemon.Id);
611 | _stats.increasePokemonsTransfered();
612 | _stats.updateConsoleTitle(_inventory);
613 | Logger.Write($"Transferred {pokemon.PokemonId} with {pokemon.Cp} CP", LogLevel.Info, ConsoleColor.Yellow);
614 | await T.Delay(rand.Next(3000, 6000));
615 | }
616 | }
617 |
618 | public async Task OverrideTransfer(int keepCp, int keepIv)
619 | {
620 | var pokemons = await _inventory.GetPokemons();
621 | var pokemonList = pokemons as IList ?? pokemons.ToList();
622 | Logger.Write($"Forcibly (override) sorting transfer of {pokemonList.Count} pokemon(s)", LogLevel.Info, ConsoleColor.Yellow);
623 | // UNTESTED
624 | foreach (var pokemon in pokemonList.Where(x => x.Favorite == 0).OrderByDescending(i => i.Cp).ThenBy(i => i.StaminaMax))
625 | {
626 | // if (!TransferList.Contains(pokemon.PokemonId))
627 | // continue;
628 | if (pokemon.Cp > keepCp || CalculatePokemonPerfection(pokemon) > keepIv)
629 | {
630 | Logger.Write($"Did not Transfer {pokemon.PokemonId} ({pokemon.Cp} cp, {CalculatePokemonPerfection(pokemon).ToString("0.00")}%) (Over Requirement) ", LogLevel.Info);
631 | continue;
632 | }
633 | var transfer = await _client.Inventory.TransferPokemon(pokemon.Id);
634 | _stats.increasePokemonsTransfered();
635 | _stats.updateConsoleTitle(_inventory);
636 | Logger.Write($"Transferred {pokemon.PokemonId} with {pokemon.Cp} CP ({CalculatePokemonPerfection(pokemon).ToString("0.00")}%)", LogLevel.Info, ConsoleColor.Yellow);
637 | await T.Delay(rand.Next(3000, 6000));
638 | }
639 | }
640 |
641 | public async Task OverrideEvolve(int keepCp, int keepIv)
642 | {
643 | var pokemonToEvolve = await _inventory.GetPokemonToEvolve();
644 | Logger.Write($"Forcibly (override) sorting evolution of {pokemonToEvolve.ToList().Count} pokemon(s)", LogLevel.Info, ConsoleColor.DarkGreen);
645 |
646 | foreach (var pokemon in pokemonToEvolve)
647 | {
648 | //if (!EvolveList.Contains(pokemon.PokemonId))
649 | // continue;
650 |
651 | if (pokemon.Cp < keepCp || CalculatePokemonPerfection(pokemon) < keepIv)
652 | {
653 | Logger.Write($"Did not Evolve {pokemon.PokemonId} ({pokemon.Cp} cp, {CalculatePokemonPerfection(pokemon).ToString("0.00")}%) (Under Requirement) ", LogLevel.Info);
654 | continue;
655 | }
656 |
657 | var evolvePokemonOutProto = await _client.Inventory.EvolvePokemon((ulong)pokemon.Id);
658 | _stats.increasePokemonsTransfered();
659 | _stats.updateConsoleTitle(_inventory);
660 | if (evolvePokemonOutProto.Result == EvolvePokemonResponse.Types.Result.Success)
661 | Logger.Write($"Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExperienceAwarded}xp", LogLevel.Info, ConsoleColor.DarkGreen);
662 | else
663 | Logger.Write($"Failed to evolve {pokemon.PokemonId}. EvolvePokemonOutProto.Result was {evolvePokemonOutProto.Result}, stopping evolving {pokemon.PokemonId}", LogLevel.Info);
664 |
665 | await T.Delay(rand.Next(3000, 5000));
666 | }
667 | }
668 |
669 |
670 | public async Task EvolvePokemonFromList()
671 | {
672 | var pokemonToEvolve = await _inventory.GetPokemonToEvolve();
673 | Logger.Write($"Sorting through {pokemonToEvolve.ToList().Count} pokemon to evolve...", LogLevel.Info, ConsoleColor.DarkGreen);
674 | foreach (var pokemon in pokemonToEvolve)
675 | {
676 | // skip ones we do not want to evolve
677 | if (!EvolveList.Contains(pokemon.PokemonId))
678 | continue;
679 |
680 | if (pokemon.Cp < UserSettings.EvolveOverCP && CalculatePokemonPerfection(pokemon) < UserSettings.EvolveOverIV)
681 | {
682 | Logger.Write($"Did not Evolve {pokemon.PokemonId} ({pokemon.Cp} cp, {CalculatePokemonPerfection(pokemon).ToString("0.00")}%) (Under Requirement) ", LogLevel.Info);
683 |
684 | continue;
685 | }
686 |
687 | var evolvePokemonOutProto = await _client.Inventory.EvolvePokemon((ulong)pokemon.Id);
688 | _stats.increasePokemonsTransfered();
689 | _stats.updateConsoleTitle(_inventory);
690 | if (evolvePokemonOutProto.Result == EvolvePokemonResponse.Types.Result.Success)
691 | Logger.Write($"Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExperienceAwarded}xp", LogLevel.Info, ConsoleColor.DarkGreen);
692 | else
693 | Logger.Write($"Failed to evolve {pokemon.PokemonId}. EvolvePokemonOutProto.Result was {evolvePokemonOutProto.Result}, stopping evolving {pokemon.PokemonId}", LogLevel.Info);
694 |
695 |
696 | await T.Delay(rand.Next(3500, 5000));
697 | }
698 | }
699 |
700 | public async Task RecycleItems()
701 | {
702 | var items = await _inventory.GetItemsToRecycle(_clientSettings);
703 |
704 | foreach (var item in items)
705 | {
706 | var transfer = await _client.Inventory.RecycleItem(item.ItemId, item.Count);
707 | Logger.Write($"Recycled {item.Count}x {item.ItemId}", LogLevel.Info, ConsoleColor.DarkYellow);
708 | await T.Delay(rand.Next(4000, 8000));
709 | }
710 | }
711 |
712 | public async Task UseLuckyEgg()
713 | {
714 | var resp = await _client.Inventory.UseItemXpBoost();
715 |
716 | return resp.Result;
717 | }
718 |
719 | }
720 | }
721 |
--------------------------------------------------------------------------------
/GoBot/Logic/Inventory.cs:
--------------------------------------------------------------------------------
1 | using POGOProtos.Data;
2 | using POGOProtos.Data.Player;
3 | using POGOProtos.Enums;
4 | using POGOProtos.Inventory;
5 | using POGOProtos.Inventory.Item;
6 | using POGOProtos.Settings.Master;
7 | using PokemonGo.RocketAPI;
8 | using System.Collections.Generic;
9 | using System.Linq;
10 | using System.Threading.Tasks;
11 |
12 | namespace GoBot.Logic
13 | {
14 | public class Inventory
15 | {
16 | private readonly Client _client;
17 | private Dictionary EvolutionRequirements = new Dictionary();
18 | public Inventory(Client client)
19 | {
20 | _client = client;
21 |
22 | EvolutionRequirements.Add(PokemonId.Abra, 25);
23 | EvolutionRequirements.Add(PokemonId.Aerodactyl, -1);
24 | EvolutionRequirements.Add(PokemonId.Arbok, -1);
25 | EvolutionRequirements.Add(PokemonId.Arcanine, -1);
26 | EvolutionRequirements.Add(PokemonId.Articuno, -1);
27 | EvolutionRequirements.Add(PokemonId.Beedrill, -1);
28 | EvolutionRequirements.Add(PokemonId.Bellsprout, 25);
29 | EvolutionRequirements.Add(PokemonId.Blastoise, -1);
30 | EvolutionRequirements.Add(PokemonId.Bulbasaur, 25);
31 | EvolutionRequirements.Add(PokemonId.Butterfree, -1);
32 | EvolutionRequirements.Add(PokemonId.Caterpie, 12);
33 | EvolutionRequirements.Add(PokemonId.Chansey, -1);
34 | EvolutionRequirements.Add(PokemonId.Charizard, -1);
35 | EvolutionRequirements.Add(PokemonId.Charmeleon, 100);
36 | EvolutionRequirements.Add(PokemonId.Clefable, -1);
37 | EvolutionRequirements.Add(PokemonId.Cloyster, -1);
38 | EvolutionRequirements.Add(PokemonId.Cubone, 50);
39 | EvolutionRequirements.Add(PokemonId.Dewgong, -1);
40 | EvolutionRequirements.Add(PokemonId.Diglett, 50);
41 | EvolutionRequirements.Add(PokemonId.Ditto, -1);
42 | EvolutionRequirements.Add(PokemonId.Dodrio, -1);
43 | EvolutionRequirements.Add(PokemonId.Doduo, 50);
44 | EvolutionRequirements.Add(PokemonId.Dragonair, 100);
45 | EvolutionRequirements.Add(PokemonId.Dragonite, -1);
46 | EvolutionRequirements.Add(PokemonId.Dratini, 25);
47 | EvolutionRequirements.Add(PokemonId.Drowzee, 50);
48 | EvolutionRequirements.Add(PokemonId.Dugtrio, -1);
49 | EvolutionRequirements.Add(PokemonId.Eevee, 25);
50 | EvolutionRequirements.Add(PokemonId.Ekans, 50);
51 | EvolutionRequirements.Add(PokemonId.Electabuzz, -1);
52 | EvolutionRequirements.Add(PokemonId.Electrode, -1);
53 | EvolutionRequirements.Add(PokemonId.Exeggcute, 50);
54 | EvolutionRequirements.Add(PokemonId.Exeggutor, -1);
55 | EvolutionRequirements.Add(PokemonId.Farfetchd, -1);
56 | EvolutionRequirements.Add(PokemonId.Fearow, -1);
57 | EvolutionRequirements.Add(PokemonId.Flareon, -1);
58 | EvolutionRequirements.Add(PokemonId.Gastly, 25);
59 | EvolutionRequirements.Add(PokemonId.Gengar, -1);
60 | EvolutionRequirements.Add(PokemonId.Gloom, 100);
61 | EvolutionRequirements.Add(PokemonId.Golbat, -1);
62 | EvolutionRequirements.Add(PokemonId.Goldeen, 50);
63 | EvolutionRequirements.Add(PokemonId.Golduck, -1);
64 | EvolutionRequirements.Add(PokemonId.Golem, -1);
65 | EvolutionRequirements.Add(PokemonId.Graveler, 100);
66 | EvolutionRequirements.Add(PokemonId.Grimer, -1);
67 | EvolutionRequirements.Add(PokemonId.Growlithe, 50);
68 | EvolutionRequirements.Add(PokemonId.Gyarados, -1);
69 | EvolutionRequirements.Add(PokemonId.Haunter, 100);
70 | EvolutionRequirements.Add(PokemonId.Hitmonchan, -1);
71 | EvolutionRequirements.Add(PokemonId.Hitmonlee, -1);
72 | EvolutionRequirements.Add(PokemonId.Horsea , 50);
73 | EvolutionRequirements.Add(PokemonId.Hypno , -1);
74 | EvolutionRequirements.Add(PokemonId.Ivysaur, 100);
75 | EvolutionRequirements.Add(PokemonId.Jigglypuff, 50);
76 | EvolutionRequirements.Add(PokemonId.Jolteon, -1);
77 | EvolutionRequirements.Add(PokemonId.Jynx, -1);
78 | EvolutionRequirements.Add(PokemonId.Kabuto, 50);
79 | EvolutionRequirements.Add(PokemonId.Kabutops, -1);
80 | EvolutionRequirements.Add(PokemonId.Kadabra, 100);
81 | EvolutionRequirements.Add(PokemonId.Kakuna, 50);
82 | EvolutionRequirements.Add(PokemonId.Kangaskhan, -1);
83 | EvolutionRequirements.Add(PokemonId.Kingler, -1);
84 | EvolutionRequirements.Add(PokemonId.Koffing, 50);
85 | EvolutionRequirements.Add(PokemonId.Krabby, 50);
86 | EvolutionRequirements.Add(PokemonId.Lapras, -1);
87 | EvolutionRequirements.Add(PokemonId.Lickitung, -1);
88 | EvolutionRequirements.Add(PokemonId.Machamp, -1);
89 | EvolutionRequirements.Add(PokemonId.Machoke , 100);
90 | EvolutionRequirements.Add(PokemonId.Machop, 25);
91 | EvolutionRequirements.Add(PokemonId.Magikarp, 400);
92 | EvolutionRequirements.Add(PokemonId.Magmar, -1);
93 | EvolutionRequirements.Add(PokemonId.Magnemite, 50);
94 | EvolutionRequirements.Add(PokemonId.Magneton, -1);
95 | EvolutionRequirements.Add(PokemonId.Mankey, 50);
96 | EvolutionRequirements.Add(PokemonId.Marowak, -1);
97 | EvolutionRequirements.Add(PokemonId.Meowth, 50);
98 | EvolutionRequirements.Add(PokemonId.Metapod, 50);
99 | EvolutionRequirements.Add(PokemonId.Mew , -1);
100 | EvolutionRequirements.Add(PokemonId.Mewtwo, -1);
101 | EvolutionRequirements.Add(PokemonId.Missingno, -1);
102 | EvolutionRequirements.Add(PokemonId.Moltres, -1);
103 | EvolutionRequirements.Add(PokemonId.MrMime, -1);
104 | EvolutionRequirements.Add(PokemonId.Muk, -1);
105 | EvolutionRequirements.Add(PokemonId.Nidoking, -1);
106 | EvolutionRequirements.Add(PokemonId.Nidoqueen, -1);
107 | EvolutionRequirements.Add(PokemonId.NidoranFemale, 25);
108 | EvolutionRequirements.Add(PokemonId.NidoranMale, 25);
109 | EvolutionRequirements.Add(PokemonId.Nidorina, 100);
110 | EvolutionRequirements.Add(PokemonId.Nidorino, 100);
111 | EvolutionRequirements.Add(PokemonId.Ninetales, -1);
112 | EvolutionRequirements.Add(PokemonId.Oddish, 25);
113 | EvolutionRequirements.Add(PokemonId.Omanyte, 50);
114 | EvolutionRequirements.Add(PokemonId.Omastar, -1);
115 | EvolutionRequirements.Add(PokemonId.Onix, -1);
116 | EvolutionRequirements.Add(PokemonId.Paras, 50);
117 | EvolutionRequirements.Add(PokemonId.Parasect, -1);
118 | EvolutionRequirements.Add(PokemonId.Persian, -1);
119 | EvolutionRequirements.Add(PokemonId.Pidgeot, -1);
120 | EvolutionRequirements.Add(PokemonId.Pidgeotto, 50);
121 | EvolutionRequirements.Add(PokemonId.Pidgey, 12);
122 | EvolutionRequirements.Add(PokemonId.Pikachu, 50);
123 | EvolutionRequirements.Add(PokemonId.Pinsir, -1);
124 | EvolutionRequirements.Add(PokemonId.Poliwag, 25);
125 | EvolutionRequirements.Add(PokemonId.Poliwhirl, 50);
126 | EvolutionRequirements.Add(PokemonId.Poliwrath, -1);
127 | EvolutionRequirements.Add(PokemonId.Ponyta, 50);
128 | EvolutionRequirements.Add(PokemonId.Porygon, -1);
129 | EvolutionRequirements.Add(PokemonId.Primeape, -1);
130 | EvolutionRequirements.Add(PokemonId.Psyduck, 50);
131 | EvolutionRequirements.Add(PokemonId.Raichu, -1);
132 | EvolutionRequirements.Add(PokemonId.Rapidash, -1);
133 | EvolutionRequirements.Add(PokemonId.Raticate, -1);
134 | EvolutionRequirements.Add(PokemonId.Rattata, 25);
135 | EvolutionRequirements.Add(PokemonId.Rhydon, -1);
136 | EvolutionRequirements.Add(PokemonId.Rhyhorn, 50);
137 | EvolutionRequirements.Add(PokemonId.Sandshrew, 50);
138 | EvolutionRequirements.Add(PokemonId.Scyther, -1);
139 | EvolutionRequirements.Add(PokemonId.Seadra , -1);
140 | EvolutionRequirements.Add(PokemonId.Seaking, -1);
141 | EvolutionRequirements.Add(PokemonId.Seel, 50);
142 | EvolutionRequirements.Add(PokemonId.Shellder, 50);
143 | EvolutionRequirements.Add(PokemonId.Slowbro, -1);
144 | EvolutionRequirements.Add(PokemonId.Slowpoke, 50);
145 | EvolutionRequirements.Add(PokemonId.Snorlax, -1);
146 | EvolutionRequirements.Add(PokemonId.Spearow , 50);
147 | EvolutionRequirements.Add(PokemonId.Squirtle, 25);
148 | EvolutionRequirements.Add(PokemonId.Starmie, -1);
149 | EvolutionRequirements.Add(PokemonId.Staryu, 50);
150 | EvolutionRequirements.Add(PokemonId.Tangela, -1);
151 | EvolutionRequirements.Add(PokemonId.Tauros, -1);
152 | EvolutionRequirements.Add(PokemonId.Tentacool, 50);
153 | EvolutionRequirements.Add(PokemonId.Tentacruel, -1);
154 | EvolutionRequirements.Add(PokemonId.Vaporeon, -1);
155 | EvolutionRequirements.Add(PokemonId.Venomoth, -1);
156 | EvolutionRequirements.Add(PokemonId.Venonat, 50);
157 | EvolutionRequirements.Add(PokemonId.Venusaur, -1);
158 | EvolutionRequirements.Add(PokemonId.Vileplume, -1);
159 | EvolutionRequirements.Add(PokemonId.Voltorb, 50);
160 | EvolutionRequirements.Add(PokemonId.Vulpix, 50);
161 | EvolutionRequirements.Add(PokemonId.Wartortle, 100);
162 | EvolutionRequirements.Add(PokemonId.Weedle, 12);
163 | EvolutionRequirements.Add(PokemonId.Weepinbell, 100);
164 | EvolutionRequirements.Add(PokemonId.Weezing, -1);
165 | EvolutionRequirements.Add(PokemonId.Wigglytuff, -1);
166 | EvolutionRequirements.Add(PokemonId.Zapdos, -1);
167 | EvolutionRequirements.Add(PokemonId.Zubat, 50);
168 | }
169 |
170 |
171 |
172 | // candy requirements
173 |
174 | public async Task> GetHighestsCP(int limit)
175 | {
176 | var myPokemon = await GetPokemons(false);
177 | var pokemons = myPokemon.ToList();
178 | return pokemons.OrderByDescending(x => x.Cp).ThenBy(n => n.StaminaMax).Take(limit);
179 | }
180 |
181 | public async Task> GetHighestsPerfect(int limit)
182 | {
183 | var myPokemon = await GetPokemons(false);
184 | var pokemons = myPokemon.ToList();
185 | return pokemons.OrderByDescending(BotInstance.CalculatePokemonPerfection).Take(limit);
186 | }
187 |
188 | public async Task GetHighestPokemonOfTypeByCP(PokemonData pokemon)
189 | {
190 | var myPokemon = await GetPokemons(false);
191 | var pokemons = myPokemon.ToList();
192 | return pokemons.Where(x => x.PokemonId == pokemon.PokemonId)
193 | .OrderByDescending(x => x.Cp)
194 | .First();
195 | }
196 |
197 | public async Task> GetPlayerStats()
198 | {
199 | var inventory = await _client.Inventory.GetInventory();
200 | return inventory.InventoryDelta.InventoryItems
201 | .Select(i => i.InventoryItemData?.PlayerStats)
202 | .Where(p => p != null);
203 | }
204 |
205 | public async Task GetLastCaughtPokemon(PokemonData match)
206 | {
207 | var inventory = await _client.Inventory.GetInventory();
208 | return
209 | inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.PokemonData)
210 | .Where(p => p != null && p?.PokemonId > 0
211 | && p?.Cp == match.Cp
212 | && p?.PokemonId == match.PokemonId
213 | && p?.WeightKg == match.WeightKg
214 | && p?.Stamina == match.Stamina
215 | && BotInstance.CalculatePokemonPerfection(p) == BotInstance.CalculatePokemonPerfection(match)).First();
216 | }
217 |
218 |
219 |
220 | public async Task> GetPokemons(bool topPokesCheck = true)
221 | {
222 | var inventory = await _client.Inventory.GetInventory();
223 |
224 | if (topPokesCheck)
225 | {
226 | var topPokes = await GetHighestsCP(UserSettings.TopX);
227 |
228 | return
229 | inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.PokemonData)
230 | .Where(p => p != null && p?.PokemonId > 0 && !topPokes.Any(i => i.Id == p.Id));
231 | }
232 | else
233 | {
234 | return
235 | inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.PokemonData)
236 | .Where(p => p != null && p?.PokemonId > 0);
237 | }
238 | }
239 |
240 | public async Task GetPokemonById(ulong id)
241 | {
242 | var myPokemon = await GetPokemons();
243 |
244 | var pokemonList = myPokemon as IList ?? myPokemon.ToList();
245 |
246 | return pokemonList.FirstOrDefault(p => p.Id == id);
247 | }
248 |
249 | public async Task> GetPokemonFamilies()
250 | {
251 | var inventory = await _client.Inventory.GetInventory();
252 | return
253 | inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.Candy)
254 | .Where(p => p != null && p?.FamilyId != PokemonFamilyId.FamilyUnset);
255 | }
256 |
257 | public async Task> GetPokemonSettings()
258 | {
259 | var templates = await _client.Download.GetItemTemplates();
260 | return
261 | templates.ItemTemplates.Select(i => i.PokemonSettings)
262 | .Where(p => p != null && p?.FamilyId != PokemonFamilyId.FamilyUnset);
263 | }
264 |
265 | public async Task GetRequiredCandy(List pokemonSettings, Candy[] pokemonFamilies, PokemonId pokemon)
266 | {
267 |
268 | var settings = pokemonSettings.Single(x => x.PokemonId == pokemon);
269 | var familyCandy = pokemonFamilies.Single(x => settings.FamilyId == x.FamilyId);
270 |
271 | return new[] { familyCandy.Candy_, settings.CandyToEvolve };
272 | }
273 |
274 | public async Task> GetDuplicatePokemonToTransfer(int belowCp, bool keepPokemonsThatCanEvolve = false)
275 | {
276 | var myPokemon = await GetPokemons();
277 |
278 | var pokemonList = myPokemon as IList ?? myPokemon.ToList();
279 | if (keepPokemonsThatCanEvolve)
280 | {
281 | var results = new List();
282 | var pokemonsThatCanBeTransfered = pokemonList.GroupBy(p => p.PokemonId)
283 | .Where(x => x.Count() > 1).ToList();
284 |
285 | var myPokemonSettings = await GetPokemonSettings();
286 | var pokemonSettings = myPokemonSettings.ToList();
287 |
288 | var myPokemonFamilies = await GetPokemonFamilies();
289 | var pokemonFamilies = myPokemonFamilies.ToArray();
290 |
291 | foreach (var pokemon in pokemonsThatCanBeTransfered)
292 | {
293 |
294 |
295 |
296 | var settings = pokemonSettings.Single(x => x.PokemonId == pokemon.Key);
297 | var familyCandy = pokemonFamilies.Single(x => settings.FamilyId == x.FamilyId);
298 |
299 | if (settings.CandyToEvolve == 0)
300 | continue;
301 |
302 |
303 |
304 | var amountToSkip = (familyCandy.Candy_ + settings.CandyToEvolve - 1) / settings.CandyToEvolve;
305 |
306 | results.AddRange(pokemonList.Where(x => x.PokemonId == pokemon.Key && x.Favorite == 0 && x.Cp < belowCp)
307 | .OrderByDescending(x => x.Cp)
308 | .ThenBy(n => n.StaminaMax)
309 | .Skip(amountToSkip)
310 | .ToList());
311 |
312 | }
313 |
314 | return results;
315 | }
316 |
317 | var topPokes = await GetHighestsCP(UserSettings.TopX);
318 |
319 | return pokemonList
320 | .GroupBy(p => p.PokemonId)
321 | .Where(x => x.Count() > 1)
322 | .SelectMany(p => p.Where(x => x.Favorite == 0 && x.Cp < belowCp && !topPokes.Any(y => x.Id == y.Id)).OrderByDescending(x => x.Cp).ThenBy(n => n.StaminaMax).Skip(1).Skip(UserSettings.TopX).ToList());
323 | }
324 |
325 |
326 | public async Task> GetPokemonToEvolve(params PokemonId[] filters)
327 | {
328 | var myPokemons = await GetPokemons();
329 | var pokemons = myPokemons.ToList();
330 |
331 | var myPokemonSettings = await GetPokemonSettings();
332 | var pokemonSettings = myPokemonSettings.ToList();
333 |
334 | var myPokemonFamilies = await GetPokemonFamilies();
335 | var pokemonFamilies = myPokemonFamilies.ToArray();
336 |
337 | var topPokemon = await GetHighestsCP(UserSettings.TopX);
338 |
339 | var pokemonToEvolve = new List();
340 | foreach (var pokemon in pokemons)
341 | {
342 |
343 | if (topPokemon.Any(i => pokemon.Id == i.Id))
344 | {
345 | // top pokemon
346 | continue;
347 | }
348 |
349 |
350 | var settings = pokemonSettings.Single(x => x.PokemonId == pokemon.PokemonId);
351 | var familyCandy = pokemonFamilies.Single(x => settings.FamilyId == x.FamilyId);
352 |
353 | //Don't evolve if we can't evolve it
354 | if (settings.EvolutionIds.Count == 0)
355 | continue;
356 |
357 | var pokemonCandyNeededAlready = pokemonToEvolve.Count(p => pokemonSettings.Single(x => x.PokemonId == p.PokemonId).FamilyId == settings.FamilyId) * settings.CandyToEvolve;
358 | if (familyCandy.Candy_ - pokemonCandyNeededAlready > settings.CandyToEvolve)
359 | pokemonToEvolve.Add(pokemon);
360 | }
361 |
362 | return pokemonToEvolve;
363 | }
364 |
365 |
366 |
367 | public async Task> GetItems()
368 | {
369 | var inventory = await _client.Inventory.GetInventory();
370 | return inventory.InventoryDelta.InventoryItems
371 | .Select(i => i.InventoryItemData?.Item)
372 | .Where(p => p != null);
373 | }
374 |
375 | public async Task GetItemAmountByType(ItemId type)
376 | {
377 | var pokeballs = await GetItems();
378 | return pokeballs.FirstOrDefault(i => (ItemId)i.ItemId == type)?.Count ?? 0;
379 | }
380 |
381 | public async Task> GetItemsToRecycle(ISettings settings)
382 | {
383 | var myItems = await GetItems();
384 |
385 | return myItems
386 | .Where(x => UserSettings.ItemRecycleFilter.Any(f => f.Key == ((ItemId)x.ItemId) && x.Count > f.Value))
387 | .Select(x => new ItemData { ItemId = x.ItemId, Count = x.Count - UserSettings.ItemRecycleFilter.Single(f => f.Key == (ItemId)x.ItemId).Value, Unseen = x.Unseen });
388 | }
389 | }
390 | }
--------------------------------------------------------------------------------
/GoBot/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace GoBot
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new FrmMain());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/GoBot/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("GoBot")]
9 | [assembly: AssemblyDescription("Pokemon Go Bot")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Pan Soft")]
12 | [assembly: AssemblyProduct("GoBot")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3151326f-7bbe-4ec1-bef3-61da43a98e01")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/GoBot/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GoBot.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GoBot.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap ash {
67 | get {
68 | object obj = ResourceManager.GetObject("ash", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap marker {
77 | get {
78 | object obj = ResourceManager.GetObject("marker", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/GoBot/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\ash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\marker.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
--------------------------------------------------------------------------------
/GoBot/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GoBot.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("Auth Token")]
29 | public string GoogleAuthValue {
30 | get {
31 | return ((string)(this["GoogleAuthValue"]));
32 | }
33 | set {
34 | this["GoogleAuthValue"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("Username")]
41 | public string Username {
42 | get {
43 | return ((string)(this["Username"]));
44 | }
45 | set {
46 | this["Username"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("Password")]
53 | public string Password {
54 | get {
55 | return ((string)(this["Password"]));
56 | }
57 | set {
58 | this["Password"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("Ptc")]
65 | public string AuthType {
66 | get {
67 | return ((string)(this["AuthType"]));
68 | }
69 | set {
70 | this["AuthType"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
77 | public double Lat {
78 | get {
79 | return ((double)(this["Lat"]));
80 | }
81 | set {
82 | this["Lat"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
89 | public double Lng {
90 | get {
91 | return ((double)(this["Lng"]));
92 | }
93 | set {
94 | this["Lng"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
101 | public int Altitude {
102 | get {
103 | return ((int)(this["Altitude"]));
104 | }
105 | set {
106 | this["Altitude"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | public global::System.Collections.ArrayList Evolve {
113 | get {
114 | return ((global::System.Collections.ArrayList)(this["Evolve"]));
115 | }
116 | set {
117 | this["Evolve"] = value;
118 | }
119 | }
120 |
121 | [global::System.Configuration.UserScopedSettingAttribute()]
122 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
123 | public global::System.Collections.ArrayList Catch {
124 | get {
125 | return ((global::System.Collections.ArrayList)(this["Catch"]));
126 | }
127 | set {
128 | this["Catch"] = value;
129 | }
130 | }
131 |
132 | [global::System.Configuration.UserScopedSettingAttribute()]
133 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
134 | public global::System.Collections.ArrayList Transfer {
135 | get {
136 | return ((global::System.Collections.ArrayList)(this["Transfer"]));
137 | }
138 | set {
139 | this["Transfer"] = value;
140 | }
141 | }
142 |
143 | [global::System.Configuration.UserScopedSettingAttribute()]
144 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
145 | [global::System.Configuration.DefaultSettingValueAttribute("50")]
146 | public int EvolveCP {
147 | get {
148 | return ((int)(this["EvolveCP"]));
149 | }
150 | set {
151 | this["EvolveCP"] = value;
152 | }
153 | }
154 |
155 | [global::System.Configuration.UserScopedSettingAttribute()]
156 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
157 | [global::System.Configuration.DefaultSettingValueAttribute("25")]
158 | public int EvolveIV {
159 | get {
160 | return ((int)(this["EvolveIV"]));
161 | }
162 | set {
163 | this["EvolveIV"] = value;
164 | }
165 | }
166 |
167 | [global::System.Configuration.UserScopedSettingAttribute()]
168 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
169 | [global::System.Configuration.DefaultSettingValueAttribute("50")]
170 | public int CatchCP {
171 | get {
172 | return ((int)(this["CatchCP"]));
173 | }
174 | set {
175 | this["CatchCP"] = value;
176 | }
177 | }
178 |
179 | [global::System.Configuration.UserScopedSettingAttribute()]
180 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
181 | [global::System.Configuration.DefaultSettingValueAttribute("50")]
182 | public int CatchIV {
183 | get {
184 | return ((int)(this["CatchIV"]));
185 | }
186 | set {
187 | this["CatchIV"] = value;
188 | }
189 | }
190 |
191 | [global::System.Configuration.UserScopedSettingAttribute()]
192 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
193 | [global::System.Configuration.DefaultSettingValueAttribute("100")]
194 | public int TransferCP {
195 | get {
196 | return ((int)(this["TransferCP"]));
197 | }
198 | set {
199 | this["TransferCP"] = value;
200 | }
201 | }
202 |
203 | [global::System.Configuration.UserScopedSettingAttribute()]
204 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
205 | [global::System.Configuration.DefaultSettingValueAttribute("25")]
206 | public int TransferIV {
207 | get {
208 | return ((int)(this["TransferIV"]));
209 | }
210 | set {
211 | this["TransferIV"] = value;
212 | }
213 | }
214 |
215 | [global::System.Configuration.UserScopedSettingAttribute()]
216 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
217 | [global::System.Configuration.DefaultSettingValueAttribute("100")]
218 | public int OverrideCP {
219 | get {
220 | return ((int)(this["OverrideCP"]));
221 | }
222 | set {
223 | this["OverrideCP"] = value;
224 | }
225 | }
226 |
227 | [global::System.Configuration.UserScopedSettingAttribute()]
228 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
229 | [global::System.Configuration.DefaultSettingValueAttribute("25")]
230 | public int OverrideIV {
231 | get {
232 | return ((int)(this["OverrideIV"]));
233 | }
234 | set {
235 | this["OverrideIV"] = value;
236 | }
237 | }
238 |
239 | [global::System.Configuration.UserScopedSettingAttribute()]
240 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
241 | public global::System.Collections.ArrayList Berries {
242 | get {
243 | return ((global::System.Collections.ArrayList)(this["Berries"]));
244 | }
245 | set {
246 | this["Berries"] = value;
247 | }
248 | }
249 |
250 | [global::System.Configuration.UserScopedSettingAttribute()]
251 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
252 | [global::System.Configuration.DefaultSettingValueAttribute("40")]
253 | public int BerriesProbability {
254 | get {
255 | return ((int)(this["BerriesProbability"]));
256 | }
257 | set {
258 | this["BerriesProbability"] = value;
259 | }
260 | }
261 |
262 | [global::System.Configuration.UserScopedSettingAttribute()]
263 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
264 | public global::System.Collections.ArrayList RecycleList {
265 | get {
266 | return ((global::System.Collections.ArrayList)(this["RecycleList"]));
267 | }
268 | set {
269 | this["RecycleList"] = value;
270 | }
271 | }
272 | }
273 | }
274 |
--------------------------------------------------------------------------------
/GoBot/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Auth Token
7 |
8 |
9 | Username
10 |
11 |
12 | Password
13 |
14 |
15 | Ptc
16 |
17 |
18 | 0
19 |
20 |
21 | 0
22 |
23 |
24 | 0
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | 50
37 |
38 |
39 | 25
40 |
41 |
42 | 50
43 |
44 |
45 | 50
46 |
47 |
48 | 100
49 |
50 |
51 | 25
52 |
53 |
54 | 100
55 |
56 |
57 | 25
58 |
59 |
60 |
61 |
62 |
63 | 40
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/GoBot/UserLogger/EventLogger.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using PokemonGo.RocketAPI;
8 | using System.Drawing;
9 | using GoBot.Utils;
10 |
11 | namespace GoBot.UserLogger
12 | {
13 | public class EventLogger : ILogger
14 | {
15 | private LogLevel maxLogLevel;
16 |
17 | public EventLogger(LogLevel maxLogLevel)
18 | {
19 | this.maxLogLevel = maxLogLevel;
20 | }
21 |
22 |
23 | public void Write(string message, LogLevel level = LogLevel.Info, ConsoleColor color = ConsoleColor.Black)
24 | {
25 | if (level > maxLogLevel)
26 | return;
27 |
28 | Utils.Events.Log("Main", message, ConsoleColorToColor(color));
29 | }
30 |
31 | private Color ConsoleColorToColor(ConsoleColor c)
32 | {
33 | switch (c)
34 | {
35 | case ConsoleColor.Blue:
36 | return "#E87DDF".ToColor();
37 | case ConsoleColor.Cyan:
38 | return "#6AD5E6".ToColor();
39 | case ConsoleColor.DarkBlue:
40 | return "#000080".ToColor();
41 | case ConsoleColor.DarkCyan:
42 | return "#008080".ToColor();
43 | case ConsoleColor.DarkGray:
44 | return "#808080".ToColor();
45 | case ConsoleColor.DarkGreen:
46 | return "#A38CFF".ToColor();
47 | case ConsoleColor.DarkMagenta:
48 | return "#800080".ToColor();
49 | case ConsoleColor.DarkRed:
50 | return "#800000".ToColor();
51 | case ConsoleColor.DarkYellow:
52 | return "#E66A7F".ToColor();
53 | case ConsoleColor.Gray:
54 | return "#C0C0C0".ToColor();
55 | case ConsoleColor.Green:
56 | return "#00FF00".ToColor();
57 | case ConsoleColor.Magenta:
58 | return "#FF00FF".ToColor();
59 | case ConsoleColor.Red:
60 | return "#FFFFFF".ToColor();
61 | case ConsoleColor.White:
62 | return "#FFFFFF".ToColor();
63 | case ConsoleColor.Yellow:
64 | return "#FFFF00".ToColor();
65 | default:
66 | return Color.FromArgb(220, 220, 220);
67 |
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/GoBot/UserLogger/ILogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace GoBot.UserLogger
5 | {
6 | ///
7 | /// All loggers must implement this interface.
8 | ///
9 | public interface ILogger
10 | {
11 | ///
12 | /// Log a specific message by LogLevel.
13 | ///
14 | /// The message to log.
15 | /// Optional. Default .
16 | /// Optional. Default automatic color.
17 | void Write(string message, LogLevel level = LogLevel.Info, ConsoleColor color = ConsoleColor.Black);
18 | }
19 | ///
20 | /// Generic logger which can be used across the projects.
21 | /// Logger should be set to properly log.
22 | ///
23 | public static class Logger
24 | {
25 | private static ILogger _logger;
26 |
27 | ///
28 | /// Set the logger. All future requests to will use that logger, any
29 | /// old will be
30 | /// unset.
31 | ///
32 | ///
33 | public static void SetLogger(ILogger logger)
34 | {
35 | _logger = logger;
36 | Log($"Initializing Rocket logger at time {DateTime.Now}...");
37 | }
38 |
39 | ///
40 | /// Log a specific message to the logger setup by .
41 | ///
42 | /// The message to log.
43 | /// Optional level to log. Default .
44 | /// Optional. Default is automatic color.
45 | public static void Write(string message, LogLevel level = LogLevel.Info, ConsoleColor color = ConsoleColor.Black)
46 | {
47 | if (_logger == null)
48 | return;
49 | _logger.Write(message, level, color);
50 | Log(string.Concat($"[{DateTime.Now.ToString("HH:mm:ss")}] ", message));
51 | }
52 |
53 | private static void Log(string message)
54 | {
55 | // maybe do a new log rather than appending?
56 | using (var log = File.AppendText("log.txt"))
57 | {
58 | log.WriteLine(message);
59 | log.Flush();
60 | }
61 | }
62 | }
63 |
64 | public enum LogLevel
65 | {
66 | None = 0,
67 | Error = 1,
68 | Warning = 2,
69 | Pokestop = 3,
70 | Farming = 4,
71 | Recycling = 5,
72 | Berry = 6,
73 | Caught = 7,
74 | Transfer = 8,
75 | Evolve = 9,
76 | Info = 10,
77 | Debug = 11
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/GoBot/UserSettings.cs:
--------------------------------------------------------------------------------
1 | using GoogleMapsApi.Entities.Directions.Request;
2 | using POGOProtos.Inventory;
3 | using POGOProtos.Inventory.Item;
4 | using PokemonGo.RocketAPI.Enums;
5 | using System.Collections.Generic;
6 |
7 | namespace GoBot
8 | {
9 | public static class UserSettings
10 | {
11 | public static string Username;
12 | public static string Password;
13 | public static AuthType Auth;
14 | public static string GoogleRefreshToken;
15 |
16 | public static double Altitude = 50;
17 | public static double StartLat;
18 | public static double StartLng;
19 | public static double WalkingSpeed;
20 |
21 | public static bool UseBerries;
22 |
23 | public static bool CatchPokemon;
24 | public static bool GetForts;
25 |
26 | public static int BerryProbability;
27 | public static int KeepCP;
28 | public static int EvolveOverCP;
29 | public static int CatchOverCP;
30 |
31 | public static int KeepIV;
32 | public static int EvolveOverIV;
33 | public static int CatchOverIV;
34 |
35 | public static int TopX;
36 | public static int CatchWalkRadius;
37 |
38 | public static bool Teleport;
39 | public static bool UseDelays = true;
40 | public static bool UseGoogleDirections;
41 |
42 | public static bool CatchPokemonOnWalk;
43 | public static bool TeleportToPokemonOnWalk;
44 |
45 | public static bool NoDupeForts;
46 |
47 |
48 | public static TravelMode ModeOfTravel = TravelMode.Walking;
49 |
50 | public static List recycleSettings = new List();
51 |
52 | public static ICollection> ItemRecycleFilter
53 | {
54 | get
55 | {
56 | return new[]
57 | {
58 | new KeyValuePair(ItemId.ItemUnknown, 0),
59 | new KeyValuePair(ItemId.ItemPokeBall, recycleSettings[0]),
60 | new KeyValuePair(ItemId.ItemGreatBall, recycleSettings[1]),
61 | new KeyValuePair(ItemId.ItemUltraBall, recycleSettings[2]),
62 | new KeyValuePair(ItemId.ItemPotion, recycleSettings[3]),
63 | new KeyValuePair(ItemId.ItemSuperPotion, recycleSettings[4]),
64 | new KeyValuePair(ItemId.ItemHyperPotion, recycleSettings[5]),
65 | new KeyValuePair(ItemId.ItemMaxPotion, recycleSettings[6]),
66 | new KeyValuePair(ItemId.ItemRevive, recycleSettings[7]),
67 | new KeyValuePair(ItemId.ItemMaxRevive, recycleSettings[8]),
68 | new KeyValuePair(ItemId.ItemRazzBerry, recycleSettings[9])
69 | };
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/GoBot/Utils/Delay.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace GoBot.Utils
4 | {
5 | public static class T
6 | {
7 | public static async Task Delay(int delay)
8 | {
9 | if (UserSettings.UseDelays)
10 | {
11 | await Task.Delay(delay);
12 | }
13 | else
14 | {
15 | return;
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/GoBot/Utils/Events.cs:
--------------------------------------------------------------------------------
1 | using GoBot.UserLogger;
2 | using POGOProtos.Data;
3 | using POGOProtos.Map.Fort;
4 | using POGOProtos.Networking.Responses;
5 | using PokemonGo.RocketAPI;
6 | using System;
7 | using System.Drawing;
8 | using System.Threading;
9 | using System.Threading.Tasks;
10 |
11 | namespace GoBot.Utils
12 | {
13 | public static class Events
14 | {
15 |
16 | public static event MessageHandler OnMessageReceived;
17 | public delegate void MessageHandler(object sender, LogReceivedArgs e);
18 |
19 | public static event PokemonCaughtHandler OnPokemonCaught;
20 | public static AsyncManualResetEvent PokemonCaughtReset = new AsyncManualResetEvent();
21 | public delegate void PokemonCaughtHandler(object sender, PokemonCaughtArgs e);
22 |
23 | public static event FortFarmedHandler OnFortFarmed;
24 | public static AsyncManualResetEvent FortFarmedReset = new AsyncManualResetEvent();
25 | public delegate void FortFarmedHandler(object sender, FortFarmedArgs e);
26 |
27 | public static event StepWalked OnStepWalked;
28 | public static AsyncManualResetEvent StepWalkedReset = new AsyncManualResetEvent();
29 | public delegate void StepWalked(object sender, StepWalkedArgs e);
30 |
31 | public static async void Log(string sender, string message, Color color)
32 | {
33 | OnMessageReceived(null, new LogReceivedArgs() { Sender = sender, Message = message, Color = color });
34 | }
35 |
36 | public static async Task FortFarmed(FortSearchResponse resp, FortData fortData)
37 | {
38 | OnFortFarmed(null, new FortFarmedArgs() { SearchResponse = resp, Fort = fortData });
39 |
40 | await FortFarmedReset.WaitAsync();
41 | FortFarmedReset.Reset();
42 | }
43 |
44 | public static async Task PokemonCaught(PokemonData poke, ulong pokemonId)
45 | {
46 | OnPokemonCaught(null, new PokemonCaughtArgs() { CaughtPokemon = poke, CaughtID = pokemonId });
47 | await PokemonCaughtReset.WaitAsync();
48 | PokemonCaughtReset.Reset();
49 | }
50 |
51 | public static async Task WaypointStepWalked(Navigation.Location currentLocation, Client client, Navigation nav)
52 | {
53 | OnStepWalked(null, new StepWalkedArgs() { curClient = client, curLocation = currentLocation, curNavigation = nav });
54 |
55 | await StepWalkedReset.WaitAsync();
56 | StepWalkedReset.Reset();
57 | }
58 | }
59 | public class AsyncManualResetEvent
60 | {
61 | private volatile TaskCompletionSource m_tcs = new TaskCompletionSource();
62 |
63 | public Task WaitAsync() { return m_tcs.Task; }
64 |
65 | public void Set()
66 | {
67 | var tcs = m_tcs;
68 | Task.Factory.StartNew(s => ((TaskCompletionSource)s).TrySetResult(true),
69 | tcs, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default);
70 | tcs.Task.Wait();
71 | }
72 |
73 | public void Reset()
74 | {
75 | while (true)
76 | {
77 | var tcs = m_tcs;
78 | if (!tcs.Task.IsCompleted ||
79 | Interlocked.CompareExchange(ref m_tcs, new TaskCompletionSource(), tcs) == tcs)
80 | return;
81 | }
82 | }
83 | }
84 | public class LogReceivedArgs : EventArgs
85 | {
86 | public string Sender;
87 | public string Message;
88 | public Color Color;
89 | }
90 | public class PokemonCaughtArgs : EventArgs
91 | {
92 | public PokemonData CaughtPokemon;
93 | public ulong CaughtID;
94 | }
95 | public class StepWalkedArgs : EventArgs
96 | {
97 | public Navigation.Location curLocation;
98 | public Navigation curNavigation;
99 | public Client curClient;
100 | }
101 | public class FortFarmedArgs : EventArgs
102 | {
103 | public FortSearchResponse SearchResponse;
104 | public FortData Fort;
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/GoBot/Utils/LocationUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using static GoBot.Utils.Navigation;
7 |
8 | namespace GoBot.Utils
9 | {
10 | public static class LocationUtils
11 | {
12 | public static Location CreateWaypoint(Location sourceLocation, double distanceInMeters, double bearingDegrees) //from http://stackoverflow.com/a/17545955
13 | {
14 | double distanceKm = distanceInMeters / 1000.0;
15 | double distanceRadians = distanceKm / 6371; //6371 = Earth's radius in km
16 |
17 | double bearingRadians = ToRad(bearingDegrees);
18 | double sourceLatitudeRadians = ToRad(sourceLocation.Latitude);
19 | double sourceLongitudeRadians = ToRad(sourceLocation.Longitude);
20 |
21 | double targetLatitudeRadians = Math.Asin(Math.Sin(sourceLatitudeRadians) * Math.Cos(distanceRadians)
22 | + Math.Cos(sourceLatitudeRadians) * Math.Sin(distanceRadians) * Math.Cos(bearingRadians));
23 |
24 | double targetLongitudeRadians = sourceLongitudeRadians + Math.Atan2(Math.Sin(bearingRadians)
25 | * Math.Sin(distanceRadians) * Math.Cos(sourceLatitudeRadians), Math.Cos(distanceRadians)
26 | - Math.Sin(sourceLatitudeRadians) * Math.Sin(targetLatitudeRadians));
27 |
28 | // adjust toLonRadians to be in the range -180 to +180...
29 | targetLongitudeRadians = ((targetLongitudeRadians + 3 * Math.PI) % (2 * Math.PI)) - Math.PI;
30 |
31 | return new Location(ToDegrees(targetLatitudeRadians), ToDegrees(targetLongitudeRadians));
32 | }
33 |
34 | public static double CalculateDistanceInMeters(Location sourceLocation, Location targetLocation) // from http://stackoverflow.com/questions/6366408/calculating-distance-between-two-latitude-and-longitude-geocoordinates
35 | {
36 | var baseRad = Math.PI * sourceLocation.Latitude / 180;
37 | var targetRad = Math.PI * targetLocation.Latitude / 180;
38 | var theta = sourceLocation.Longitude - targetLocation.Longitude;
39 | var thetaRad = Math.PI * theta / 180;
40 |
41 | double dist =
42 | Math.Sin(baseRad) * Math.Sin(targetRad) + Math.Cos(baseRad) *
43 | Math.Cos(targetRad) * Math.Cos(thetaRad);
44 | dist = Math.Acos(dist);
45 |
46 | dist = dist * 180 / Math.PI;
47 | dist = dist * 60 * 1.1515 * 1.609344 * 1000;
48 |
49 | return dist;
50 | }
51 |
52 | public static double DegreeBearing(Location sourceLocation, Location targetLocation) // from http://stackoverflow.com/questions/2042599/direction-between-2-latitude-longitude-points-in-c-sharp
53 | {
54 | var dLon = ToRad(targetLocation.Longitude - sourceLocation.Longitude);
55 | var dPhi = Math.Log(
56 | Math.Tan(ToRad(targetLocation.Latitude) / 2 + Math.PI / 4) / Math.Tan(ToRad(sourceLocation.Latitude) / 2 + Math.PI / 4));
57 | if (Math.Abs(dLon) > Math.PI)
58 | dLon = dLon > 0 ? -(2 * Math.PI - dLon) : (2 * Math.PI + dLon);
59 | return ToBearing(Math.Atan2(dLon, dPhi));
60 | }
61 |
62 | public static double ToRad(double degrees)
63 | {
64 | return degrees * (Math.PI / 180);
65 | }
66 |
67 | public static double ToDegrees(double radians)
68 | {
69 | return radians * 180 / Math.PI;
70 | }
71 |
72 | public static double ToBearing(double radians)
73 | {
74 | // convert radians to degrees (as bearing: 0...360)
75 | return (ToDegrees(radians) + 360) % 360;
76 | }
77 | }
78 | }
--------------------------------------------------------------------------------
/GoBot/Utils/Navigation.cs:
--------------------------------------------------------------------------------
1 | using GoBot.UserLogger;
2 | using POGOProtos.Networking.Responses;
3 | using PokemonGo.RocketAPI;
4 | using System;
5 | using System.Threading.Tasks;
6 |
7 | using GoogleMapsApi;
8 | using GoogleMapsApi.Entities.Common;
9 | using GoogleMapsApi.Entities.Directions.Request;
10 | using GoogleMapsApi.Entities.Directions.Response;
11 | using GoogleMapsApi.Entities.Geocoding.Request;
12 | using GoogleMapsApi.Entities.Geocoding.Response;
13 | using GoogleMapsApi.StaticMaps;
14 | using GoogleMapsApi.StaticMaps.Entities;
15 | using System.Collections.Generic;
16 | using System.Linq;
17 | using GoBot.Logic;
18 | using PokemonGo.RocketAPI.Exceptions;
19 |
20 | namespace GoBot.Utils
21 | {
22 | public class Navigation
23 | {
24 |
25 | private static readonly double speedDownTo = 10 / 3.6;
26 | private readonly Client _client;
27 | private BotInstance _bot;
28 |
29 | public Location FinalDestination;
30 | public List> DestinationSteps = new List>();
31 |
32 | private Random rand = new Random();
33 | public Navigation(Client client, BotInstance bot)
34 | {
35 | _client = client;
36 | _bot = bot;
37 | }
38 |
39 | public async Task HumanLikeWalking(Location targetLocation, double walkingSpeedInKilometersPerHour, bool slowDown = true, bool bypassEvent = false)
40 | {
41 | double speedInMetersPerSecond = walkingSpeedInKilometersPerHour / 3.6;
42 |
43 | Location sourceLocation = new Location(_client.CurrentLatitude, _client.CurrentLongitude);
44 |
45 | Logger.Write($"Distance to target location: {LocationUtils.CalculateDistanceInMeters(sourceLocation, targetLocation):0.##} meters.", LogLevel.Info);
46 |
47 | double nextWaypointBearing = LocationUtils.DegreeBearing(sourceLocation, targetLocation);
48 | double nextWaypointDistance = speedInMetersPerSecond;
49 | Location waypoint = LocationUtils.CreateWaypoint(sourceLocation, nextWaypointDistance, nextWaypointBearing);
50 |
51 | //Initial walking
52 | DateTime requestSendDateTime = DateTime.Now;
53 | var result = await _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude, rand.Next((int)UserSettings.Altitude - 10, (int)UserSettings.Altitude + 10));
54 |
55 | do
56 | {
57 |
58 | speedInMetersPerSecond = rand.Next((int)walkingSpeedInKilometersPerHour - 5, (int)walkingSpeedInKilometersPerHour + 5) / 3.6;
59 | await Task.Delay(3000);
60 | double millisecondsUntilGetUpdatePlayerLocationResponse = (DateTime.Now - requestSendDateTime).TotalMilliseconds;
61 |
62 | sourceLocation = new Location(_client.CurrentLatitude, _client.CurrentLongitude);
63 |
64 | if (LocationUtils.CalculateDistanceInMeters(sourceLocation, targetLocation) < 40 && slowDown)
65 | {
66 |
67 | if (speedInMetersPerSecond > speedDownTo)
68 | {
69 | Logger.Write("We are within 40 meters of the target. Slowing down to 10 km/h to not pass the target.", LogLevel.Info);
70 | speedInMetersPerSecond = speedDownTo;
71 | }
72 | else
73 | {
74 | Logger.Write("We are within 40 meters of the target, attempting to interact.", LogLevel.Info);
75 | }
76 | }
77 | else
78 | {
79 | Logger.Write($"Distance to target location: {LocationUtils.CalculateDistanceInMeters(sourceLocation, targetLocation):0.##} meters.", LogLevel.Debug);
80 | }
81 |
82 | nextWaypointDistance = millisecondsUntilGetUpdatePlayerLocationResponse / 1000 * speedInMetersPerSecond;
83 | nextWaypointBearing = LocationUtils.DegreeBearing(sourceLocation, targetLocation);
84 | waypoint = LocationUtils.CreateWaypoint(sourceLocation, nextWaypointDistance, nextWaypointBearing);
85 |
86 | requestSendDateTime = DateTime.Now;
87 | result = await _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude, rand.Next((int)UserSettings.Altitude - 10, (int)UserSettings.Altitude + 10));
88 |
89 | // Wait for the event
90 | if (!bypassEvent)
91 | {
92 | await Events.WaypointStepWalked(waypoint, _client, this);
93 |
94 | }
95 | if (_bot.restarting)
96 | {
97 | _bot.restarting = false;
98 | throw new InvalidResponseException();
99 | }
100 | } while (LocationUtils.CalculateDistanceInMeters(sourceLocation, targetLocation) >= 30);
101 |
102 | return result;
103 | }
104 |
105 |
106 | public async Task DirectionalWalking(Location target, double walkSpeed, bool bypassEvents = false)
107 | {
108 | PlayerUpdateResponse resp = null;
109 | FinalDestination = target;
110 | DestinationSteps.Clear();
111 |
112 | if (!UserSettings.UseGoogleDirections)
113 | {
114 | List destSteps = new List();
115 | destSteps.Add(new GMap.NET.PointLatLng(_client.CurrentLatitude, _client.CurrentLongitude));
116 | destSteps.Add(new GMap.NET.PointLatLng(target.Latitude, target.Longitude));
117 | DestinationSteps.Add(destSteps);
118 |
119 | var update = await HumanLikeWalking(target, walkSpeed, true, bypassEvents);
120 | return update;
121 | }
122 |
123 | DirectionsRequest directionsRequest = new DirectionsRequest()
124 | {
125 | Origin = _client.CurrentLatitude + "," + _client.CurrentLongitude,
126 | Destination = target.Latitude + "," + target.Longitude,
127 | TravelMode = UserSettings.ModeOfTravel
128 | };
129 | DirectionsResponse directions = GoogleMaps.Directions.Query(directionsRequest);
130 |
131 | if (directions.Routes.ToList().Count == 0)
132 | {
133 | List destSteps = new List();
134 | destSteps.Add(new GMap.NET.PointLatLng(_client.CurrentLatitude, _client.CurrentLongitude));
135 | destSteps.Add(new GMap.NET.PointLatLng(target.Latitude, target.Longitude));
136 | DestinationSteps.Add(destSteps);
137 |
138 | return await HumanLikeWalking(target, walkSpeed, true, bypassEvents);
139 | }
140 | if (directions.Routes.First().Legs.ToList().Count == 0)
141 | {
142 | List destSteps = new List();
143 | destSteps.Add(new GMap.NET.PointLatLng(_client.CurrentLatitude, _client.CurrentLongitude));
144 | destSteps.Add(new GMap.NET.PointLatLng(target.Latitude, target.Longitude));
145 | DestinationSteps.Add(destSteps);
146 |
147 | return await HumanLikeWalking(target, walkSpeed, true, bypassEvents);
148 | }
149 |
150 | IEnumerable steps = directions.Routes.First().Legs.First().Steps;
151 | foreach (var s in steps)
152 | {
153 | List destSteps = new List();
154 | destSteps.Add(new GMap.NET.PointLatLng(s.StartLocation.Latitude, s.StartLocation.Longitude));
155 | destSteps.Add(new GMap.NET.PointLatLng(s.EndLocation.Latitude, s.EndLocation.Longitude));
156 | DestinationSteps.Add(destSteps);
157 | }
158 | foreach (var s in steps)
159 | {
160 |
161 | Logger.Write($"Currently on step {steps.ToList().IndexOf(s) + 1} of {steps.ToList().Count}");
162 | //Logger.Write($"Direction Text: {s.HtmlInstructions.StripTags()}");
163 |
164 | resp = await HumanLikeWalking(new Location(s.EndLocation.Latitude, s.EndLocation.Longitude), walkSpeed, false, bypassEvents);
165 | }
166 | if (_client.CurrentLatitude != target.Latitude && _client.CurrentLongitude != target.Longitude)
167 | {
168 | // do last steps
169 | resp = await HumanLikeWalking(target, walkSpeed, true, bypassEvents);
170 | Logger.Write($"Corrected location to exact coordinates: {target.Latitude}, {target.Longitude}");
171 | }
172 | Logger.Write($"Client is now at {_client.CurrentLatitude}, {_client.CurrentLongitude}, target was: {target.Latitude}, {target.Longitude}");
173 | return resp;
174 | }
175 |
176 | public class Location
177 | {
178 | public double Latitude { get; set; }
179 | public double Longitude { get; set; }
180 |
181 | public Location(double latitude, double longitude)
182 | {
183 | Latitude = latitude;
184 | Longitude = longitude;
185 | }
186 | }
187 | }
188 | }
--------------------------------------------------------------------------------
/GoBot/Utils/NumberUtils.cs:
--------------------------------------------------------------------------------
1 | using GoBot.UserLogger;
2 | using PokemonGo.RocketAPI;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace GoBot.Utils
10 | {
11 | public static class NumberUtils
12 | {
13 | public static double ToDouble(this string str)
14 | {
15 | double o = 0;
16 |
17 | if (double.TryParse(str, out o))
18 | {
19 | return o;
20 | }
21 | Logger.Write($"Could not parse double: {str})");
22 | return o;
23 | }
24 | public static int ToInt(this string str)
25 | {
26 | int o = 0;
27 |
28 | if (int.TryParse(str, out o))
29 | {
30 | return o;
31 | }
32 | Logger.Write($"Could not parse int: {str})");
33 | return o;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/GoBot/Utils/Settings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using PokemonGo.RocketAPI;
3 | using PokemonGo.RocketAPI.Enums;
4 |
5 | namespace GoBot
6 | {
7 | public class Settings : ISettings
8 | {
9 | public double WalkingSpeedInKilometerPerHour => UserSettings.WalkingSpeed;
10 |
11 |
12 | public string GoogleRefreshToken
13 | {
14 | get { return UserSettings.GoogleRefreshToken; }
15 | set
16 | {
17 | UserSettings.GoogleRefreshToken = value;
18 | }
19 | }
20 |
21 | AuthType ISettings.AuthType
22 | {
23 | get
24 | {
25 | return UserSettings.Auth;
26 | }
27 |
28 | set
29 | {
30 | UserSettings.Auth = value;
31 | }
32 | }
33 |
34 | double ISettings.DefaultLatitude
35 | {
36 | get
37 | {
38 | return UserSettings.StartLat;
39 | }
40 |
41 | set
42 | {
43 | UserSettings.StartLat = value;
44 | }
45 | }
46 |
47 | double ISettings.DefaultLongitude
48 | {
49 | get
50 | {
51 | return UserSettings.StartLng;
52 | }
53 |
54 | set
55 | {
56 | UserSettings.StartLng = value;
57 | }
58 | }
59 |
60 | double ISettings.DefaultAltitude
61 | {
62 | get
63 | {
64 | return UserSettings.Altitude;
65 | }
66 |
67 | set
68 | {
69 | UserSettings.Altitude = value;
70 | }
71 | }
72 |
73 | string ISettings.PtcPassword
74 | {
75 | get
76 | {
77 | return UserSettings.Password;
78 | }
79 |
80 | set
81 | {
82 | UserSettings.Password = value;
83 | }
84 | }
85 |
86 | string ISettings.PtcUsername
87 | {
88 | get
89 | {
90 | return UserSettings.Username;
91 | }
92 |
93 | set
94 | {
95 | UserSettings.Username = value;
96 | }
97 | }
98 |
99 | public string GoogleUsername
100 | {
101 | get
102 | {
103 | return UserSettings.Username;
104 | }
105 |
106 | set
107 | {
108 | UserSettings.Username = value;
109 | }
110 | }
111 |
112 | public string GooglePassword
113 | {
114 | get
115 | {
116 | return UserSettings.Password;
117 | }
118 |
119 | set
120 | {
121 | UserSettings.Password = value;
122 | }
123 | }
124 | }
125 | }
--------------------------------------------------------------------------------
/GoBot/Utils/Statistics.cs:
--------------------------------------------------------------------------------
1 | using GoBot.Logic;
2 | using GoBot.UserLogger;
3 | using POGOProtos.Data.Player;
4 | using System;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 |
8 | namespace GoBot.Utils
9 | {
10 | public class Statistics
11 | {
12 | public static int _totalExperience;
13 | public static int _totalPokemons;
14 | public static int _totalItemsRemoved;
15 | public static int _totalPokemonsTransfered;
16 | public static int _totalStardust;
17 | public static string _currentLevelInfos;
18 | public static int Currentlevel = -1;
19 | private static string _lvlUp;
20 | private static string _curLevel;
21 | private static string _reqXP;
22 |
23 | public static DateTime _initSessionDateTime = DateTime.Now;
24 |
25 | public static double _getSessionRuntime()
26 | {
27 | return ((DateTime.Now - _initSessionDateTime).TotalSeconds) / 3600;
28 | }
29 |
30 | public void addExperience(int xp)
31 | {
32 | _totalExperience += xp;
33 | }
34 |
35 | public async Task _getcurrentLevelInfos(Inventory _inventory)
36 | {
37 | // pokeballs
38 |
39 |
40 | var stats = await _inventory.GetPlayerStats();
41 | var output = string.Empty;
42 | PlayerStats stat = stats.FirstOrDefault();
43 | if (stat != null)
44 | {
45 |
46 | var _ep = (stat.NextLevelXp - stat.PrevLevelXp) - (stat.Experience - stat.PrevLevelXp);
47 | var _hours = Math.Round(_ep / (_totalExperience / _getSessionRuntime()), 2);
48 |
49 | _lvlUp = _hours.ToString("0.00");
50 | _curLevel = stat.Level.ToString();
51 | _reqXP = $"{ stat.Experience - stat.PrevLevelXp - GetXpDiff(stat.Level)}/{ stat.NextLevelXp - stat.PrevLevelXp - GetXpDiff(stat.Level)}";
52 |
53 | output = $"{stat.Level} (LvLUp in {_hours}hours // {stat.Experience - stat.PrevLevelXp - GetXpDiff(stat.Level)}/{stat.NextLevelXp - stat.PrevLevelXp - GetXpDiff(stat.Level)} XP)";
54 | }
55 | return output;
56 | }
57 |
58 | public void increasePokemons()
59 | {
60 | _totalPokemons += 1;
61 | }
62 |
63 | public void getStardust(int stardust)
64 | {
65 | _totalStardust = stardust;
66 | }
67 |
68 | public void addItemsRemoved(int count)
69 | {
70 | _totalItemsRemoved += count;
71 | }
72 |
73 | public void increasePokemonsTransfered()
74 | {
75 | _totalPokemonsTransfered += 1;
76 | }
77 |
78 | public async void updateConsoleTitle(Inventory _inventory)
79 | {
80 | // can throw invalid response exception
81 | try
82 | {
83 | _currentLevelInfos = await _getcurrentLevelInfos(_inventory);
84 | }
85 | catch (Exception ex)
86 | {
87 | Logger.Write("Stat Update Exception: " + ex.ToString());
88 | }
89 | //Console.Title = ToString();
90 | }
91 | public static string ProgramRuntime
92 | {
93 | get
94 | {
95 | TimeSpan time = (DateTime.Now - _initSessionDateTime);
96 | return string.Format("Runtime: {0}", time.ToPretty());
97 | //return string.Format((DateTime.Now - _initSessionDateTime).ToString("h'hours 'm'm 's's'")
98 | }
99 | }
100 | public static string PlayerLevel
101 | {
102 | get
103 | {
104 | return string.Format("Level: Currently {0}", _curLevel);
105 | }
106 | }
107 | public static string LevelUp
108 | {
109 | get
110 | {
111 | if (_lvlUp == null)
112 | return "Level up in -";
113 | double lvlUpDbl = _lvlUp.ToDouble();
114 |
115 | if (lvlUpDbl > 50000 || double.IsInfinity(lvlUpDbl) || double.IsNaN(lvlUpDbl) || double.IsNegativeInfinity(lvlUpDbl) || double.IsPositiveInfinity(lvlUpDbl) || lvlUpDbl == 0 || lvlUpDbl > int.MaxValue)
116 | return "Level up in 50k+ hours! :(";
117 | return string.Format("Level up in {0}", TimeSpan.FromHours(lvlUpDbl).ToPretty());
118 | }
119 | }
120 | public static string ExperiencePerHour
121 | {
122 | get
123 | {
124 | return string.Format("XP/H: {0:0.0}", _totalExperience / _getSessionRuntime());
125 | }
126 | }
127 | public static string RequiredXP
128 | {
129 | get
130 | {
131 | return string.Format("( Required XP: {0:0.0} )", _reqXP);
132 | }
133 | }
134 | public static string PokemonFound
135 | {
136 | get
137 | {
138 | return "Pokemon Found: " + _totalPokemons.ToString();
139 | }
140 | }
141 | public static string Stardust
142 | {
143 | get
144 | {
145 | return "Stardust: " + _totalStardust.ToString();
146 | }
147 |
148 | }
149 | public static string PokemonTransferred
150 | {
151 | get
152 | {
153 | return "Pokemon Transferred: " + _totalPokemonsTransfered.ToString();
154 | }
155 |
156 |
157 | }
158 | public static string PokemonPerHour
159 | {
160 | get
161 | {
162 | return string.Format("Pokemon/H: {0:0.0}", _totalPokemons / _getSessionRuntime());
163 | }
164 |
165 | }
166 | public override string ToString()
167 | {
168 | return string.Format("LvL: {1:0}{0}EXP/H: {2:0.0} EXP{0}P/H: {3:0.0} Pokemon(s){0}Stardust: {4:0}{0}Pokemon Transfered: {5:0}{0}Items Removed: {6:0}{0}", Environment.NewLine, _currentLevelInfos, _totalExperience / _getSessionRuntime(), _totalPokemons / _getSessionRuntime(), _totalStardust, _totalPokemonsTransfered, _totalItemsRemoved);
169 | }
170 |
171 | public static int GetXpDiff(int level)
172 | {
173 | switch (level)
174 | {
175 | case 1:
176 | return 0;
177 | case 2:
178 | return 1000;
179 | case 3:
180 | return 2000;
181 | case 4:
182 | return 3000;
183 | case 5:
184 | return 4000;
185 | case 6:
186 | return 5000;
187 | case 7:
188 | return 6000;
189 | case 8:
190 | return 7000;
191 | case 9:
192 | return 8000;
193 | case 10:
194 | return 9000;
195 | case 11:
196 | return 10000;
197 | case 12:
198 | return 10000;
199 | case 13:
200 | return 10000;
201 | case 14:
202 | return 10000;
203 | case 15:
204 | return 15000;
205 | case 16:
206 | return 20000;
207 | case 17:
208 | return 20000;
209 | case 18:
210 | return 20000;
211 | case 19:
212 | return 25000;
213 | case 20:
214 | return 25000;
215 | case 21:
216 | return 50000;
217 | case 22:
218 | return 75000;
219 | case 23:
220 | return 100000;
221 | case 24:
222 | return 125000;
223 | case 25:
224 | return 150000;
225 | case 26:
226 | return 190000;
227 | case 27:
228 | return 200000;
229 | case 28:
230 | return 250000;
231 | case 29:
232 | return 300000;
233 | case 30:
234 | return 350000;
235 | case 31:
236 | return 500000;
237 | case 32:
238 | return 500000;
239 | case 33:
240 | return 750000;
241 | case 34:
242 | return 1000000;
243 | case 35:
244 | return 1250000;
245 | case 36:
246 | return 1500000;
247 | case 37:
248 | return 2000000;
249 | case 38:
250 | return 2500000;
251 | case 39:
252 | return 1000000;
253 | case 40:
254 | return 1000000;
255 | }
256 | return 0;
257 | }
258 | }
259 | }
260 |
--------------------------------------------------------------------------------
/GoBot/Utils/StringUtils.cs:
--------------------------------------------------------------------------------
1 | using POGOProtos.Inventory;
2 | using POGOProtos.Inventory.Item;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 |
9 | namespace GoBot.Utils
10 | {
11 | public static class StringUtils
12 | {
13 | public static string GetSummedFriendlyNameOfItemAwardList(IEnumerable items)
14 | {
15 | var enumerable = items as IList ?? items.ToList();
16 |
17 | if (!enumerable.Any())
18 | return string.Empty;
19 |
20 | return
21 | enumerable.GroupBy(i => i.ItemId)
22 | .Select(kvp => new { ItemName = kvp.Key.ToString(), Amount = kvp.Sum(x => x.ItemCount) })
23 | .Select(y => $"{y.Amount} x {y.ItemName}")
24 | .Aggregate((a, b) => $"{a}, {b}");
25 | }
26 | public static Color ToColor(this string str)
27 | {
28 | return Helpers.ColorFromHex(str);
29 | }
30 | public static string ToNormal(this string str)
31 | {
32 | StringBuilder builder = new StringBuilder();
33 | foreach (char c in str)
34 | {
35 | if (char.IsUpper(c) && builder.Length > 0) builder.Append(' ');
36 | builder.Append(c);
37 | }
38 | return builder.ToString();
39 | }
40 | public static string ToPretty(this TimeSpan time)
41 | {
42 | return string.Format("{0} hour{3}, {1} minute{4}, {2} second{5}", time.Hours, time.Minutes, time.Seconds,
43 | time.Hours > 1 ? "s" : "",
44 | time.Minutes > 1 ? "s" : "",
45 | time.Seconds > 1 ? "s" : "");
46 | }
47 | public static string StripTags(this string source)
48 | {
49 | char[] array = new char[source.Length];
50 | int arrayIndex = 0;
51 | bool inside = false;
52 |
53 | for (int i = 0; i < source.Length; i++)
54 | {
55 | char let = source[i];
56 | if (let == '<')
57 | {
58 | inside = true;
59 | continue;
60 | }
61 | if (let == '>')
62 | {
63 | inside = false;
64 | continue;
65 | }
66 | if (!inside)
67 | {
68 | array[arrayIndex] = let;
69 | arrayIndex++;
70 | }
71 | }
72 | return new string(array, 0, arrayIndex);
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/GoBot/ash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/GoBot/ash.png
--------------------------------------------------------------------------------
/GoBot/go.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/GoBot/go.ico
--------------------------------------------------------------------------------
/GoBot/marker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/GoBot/marker.png
--------------------------------------------------------------------------------
/GoBot/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GoBot
2 | A simple bot using the Rocket API for Pokemon Go.
3 | **Currently Discontinued due to API updates. May resume development sometime**
4 |
5 | # Warning
6 | This is not a fully functioning bot. This was made in only a couple of hours. The API that this uses changes several hundred times a day.
7 | If you build from source there may be some small issues to fix (as you will have to download the API too!)
8 |
9 | # Screenshots
10 | 
11 | 
12 | 
13 |
14 | # API Link
15 | https://github.com/FeroxRev/Pokemon-Go-Rocket-API
16 |
17 | # Features
18 | - Walking (human)
19 | - Custom speeds
20 | - Lat/Lng positon (and walks back on reset)
21 | - Evolve Selected (or unselected) pokemon - CP/IV filter
22 | - If both match it will evolve, otherwise it will not evolve.
23 | - Catch Selected (or unselected) pokemon - CP/IV filter
24 | - If both match it will catch, otherwise it will TRANSFER them.
25 | - Transfer Selected (or unselected) pokemon - CP/IV filter
26 | - If EITHER match (cp/iv) it will NOT transfer the pokemon.
27 | - Use berries on certain pokemons if probability of capture is less than x (out of 100)
28 | - Recycle certain items if you have more than the specified amount
29 | - Basic statistics (thanks to: https://github.com/Spegeli/Pokemon-Go-Rocket-API)
30 | - Perform tasks while idling in a location
31 | - Evolve, or transfer selected pokemon from your inventory
32 | - Show your pokemon inventory, pokeball inventory, or item inventory (detailed).
33 | - Google Maps integration - live minimap!
34 | - Google Direction API Integrated
35 |
36 | # Donate
37 | Bitcoin Address: 1LAPANo2N1jBBBHvBEqbMxG13pWqV1xCsY
38 |
39 |
40 | # To Do
41 | - Don't waste pokeballs on softbanned accounts
42 | - Tutorial for retards
43 | - Lured pokemons
44 | - Deploy insense
45 | - Account item count/pokemon counts
46 |
--------------------------------------------------------------------------------
/packages/GMap.NET.WindowsForms.1.7.1/GMap.NET.WindowsForms.1.7.1.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/packages/GMap.NET.WindowsForms.1.7.1/GMap.NET.WindowsForms.1.7.1.nupkg
--------------------------------------------------------------------------------
/packages/GMap.NET.WindowsForms.1.7.1/lib/net20/GMap.NET.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/packages/GMap.NET.WindowsForms.1.7.1/lib/net20/GMap.NET.Core.dll
--------------------------------------------------------------------------------
/packages/GMap.NET.WindowsForms.1.7.1/lib/net20/GMap.NET.WindowsForms.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/packages/GMap.NET.WindowsForms.1.7.1/lib/net20/GMap.NET.WindowsForms.dll
--------------------------------------------------------------------------------
/packages/GMap.NET.WindowsForms.1.7.1/lib/net40/GMap.NET.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/packages/GMap.NET.WindowsForms.1.7.1/lib/net40/GMap.NET.Core.dll
--------------------------------------------------------------------------------
/packages/GMap.NET.WindowsForms.1.7.1/lib/net40/GMap.NET.WindowsForms.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/packages/GMap.NET.WindowsForms.1.7.1/lib/net40/GMap.NET.WindowsForms.dll
--------------------------------------------------------------------------------
/packages/GMap.NET.WindowsForms.1.7.1/readme.txt:
--------------------------------------------------------------------------------
1 |
2 | *** GMap.NET - Great Maps for Windows Forms & Presentation ***
3 |
4 | GMap.NET is great and Powerful, Free, cross platform, open source
5 | .NET control. Enable use routing, geocoding, directions and maps
6 | from Coogle, Yahoo!, Bing, OpenStreetMap, ArcGIS, Pergo, SigPac,
7 | Yandex, Mapy.cz, Maps.lt, iKarte.lv, NearMap, OviMap, CloudMade,
8 | WikiMapia in Windows Forms & Presentation, supports caching
9 | and runs on windows mobile!!
10 |
11 |
12 | License: The MIT License (MIT)
13 | -------------------------------------------------------------------
14 | Copyright (c) 2008-2011 Universe, WARNING: This software can access some
15 | map providers and may viotile their Terms of Service, you use it at your
16 | own risk, nothing is forcing you to accept this ;} Source itself is legal!
17 |
18 | Permission is hereby granted, free of charge, to any person obtaining
19 | a copy of this software and associated documentation files (the "Software"),
20 | to deal in the Software without restriction, including without limitation
21 | the rights to use, copy, modify, merge, publish, distribute, sublicense,
22 | and/or sell copies of the Software, and to permit persons to whom the
23 | Software is furnished to do so, subject to the following conditions:
24 | The above copyright notice and this permission notice shall be included
25 | in all copies or substantial portions of the Software.
26 |
27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
28 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
33 | IN THE SOFTWARE.
34 | -------------------------------------------------------------------
--------------------------------------------------------------------------------
/packages/GoogleMapsApi.0.56.0/GoogleMapsApi.0.56.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/packages/GoogleMapsApi.0.56.0/GoogleMapsApi.0.56.0.nupkg
--------------------------------------------------------------------------------
/packages/GoogleMapsApi.0.56.0/lib/net45/GoogleMapsApi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Panthere/GoBot/362d58f0d30e0abed1fc2c621ec52dda678f0f70/packages/GoogleMapsApi.0.56.0/lib/net45/GoogleMapsApi.dll
--------------------------------------------------------------------------------