This is a quick and dirty way to keep the google login persistent using Google Refresh Token
- In GoogleLogin.cs line 32 you will find this code
Code:
Console.WriteLine("Logged in Google Account..");
Below that code insert this line:
Code:
Console.WriteLine("Refresh Token: " + tokenResponse.refresh_token);
This will print the refresh token after you enter the user code at google.com/device
- Copy the refresh token and go to App.config and paste the value in the "GoogleRefreshToken" key
I believe the problem was the refresh token was not written in a persistent config file so when the auth timed out the program couldn't find the right refresh code.
There are some snippet in this thread that makes the bot auto restart when it crashes.
Code:
try
{
System.Console.WriteLine("||Farm Started||");
await ExecuteFarmingPokestopsAndPokemons(client);
System.Console.WriteLine("Unexpected stop? Restarting in 40 seconds.");
await Task.Delay(40000);
Execute();
}
catch (TaskCanceledException tce) { System.Console.WriteLine("Task Canceled Exception - Restarting"); Execute(); }
catch (UriFormatException ufe) { System.Console.WriteLine("System URI Format Exception - Restarting"); Execute(); }
catch (ArgumentOutOfRangeException aore) { System.Console.WriteLine("ArgumentOutOfRangeException - Restarting"); Execute(); }
catch (NullReferenceException nre) { System.Console.WriteLine("Null Refference - Restarting"); Execute(); }
This will make the bot run hopefully 24/7