Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
0.69.0 Support - Various Updates
Browse files Browse the repository at this point in the history
* Added 0 value to unknown level

* Typo correction

* Map Zoom bar fix
Zoom bar would grow and shrink.
Now it moves as map window grows and shrinks.

* Try to fixes show start raids and boss raids

* Centred boss image

* update gym/team colors
Added Neutral Team/Gym Color
typos and team color default
Changed default team color to Neutral.
Typo cBoxTeaamColor.Text to cBoxTeamColor.Text

* Try to fixes show start raids and boss raids WPF GUI init

* Rocketbot v2.11.0.17

* revise raids

* Update image and add missed assets

* Typo's corrected
code clean up

* Update POGOProtos

* Fixes to Lured pokestop (rocketbot)

* Changed mulitbot account selector

Changed Multi bot account selector from Runtimetotal & ID to Lowest
level & XP.
- to x in item rewards for trainer level ups

* changed RAID message bubble

Changed from time to raid start/end to actual time of RAID Start/end

* fix bug

* Optimize code
fixes timers tooltips

* Fixes various bugs
Typo resources update
Try to Fixes MainMap (rocketbot)

* fix bug

* RocketBot release v2.11.0.18

* revise code

* cleanup

* Update POGOProtos

* try to fixes NullReferenceExeption (rocketbot)

* try to fixes NullReferenceExeption

* added warn flagged into status text caption
fixes raidinfos

* Typo code

* Logic changed

Bot will start by choosing account with the lowest level and XP to
start.

* typo code

* Simplify code

* move var

* simplify variable

* Optimize code

* Fixes code

* RocketBot2  Release v2.11.0.19

* added Raid Spawn
added autostart to commande line (rocketbot)

RocketBot2 Release v2.11.0.20

* changed Alignmemt in olvPokemonList

changed some alignments to centered
Changed Raid Times from H & M remaining to actual time to start and end.

* Fixed some Transaltion code

* remove unused code

* fixes cmd line
auto start rocketbot2 -a true

* fixes cmd line (rocketbot)
auto start rocketbot2 -a true or --autostart true

* RocketBot2 v2.11.0.21

* remove unused code

* Improve headers, add locale

* Improve headers, add locale

Add missing headers
Add locale for parameter and accept language

* Rebase values

* fixes times

* fixes times bug

* fixes times bug
RocketBot2 v2.11.0.22

* CleanUp
RocketBot2 v2.11.0.23

* fixes possibles bugs
Update feroxvrev

* Update deps

* Change refresh main map methodes (rocketobot)
Fix bug NecroBot.Windows project file
Rocketbot v2.11.0.25

* fix bug

* Update headers
Fixe Proxy

* Added Notification Date & Time to Pushbullet notifications

* Fixes loop pokestops

* Fixes loop pokestops

* minor fixes

* Fixes CPU usages
Fixes bugs

* Simplify code

* Fixes CPU usages
Fixes bugs

* Added spawn resources

* Added PushBullet settings  …
MainForm:
Added PushBullet Checkbox to Advanced Settings
Settings:
Added PushBullet Checkbox to settings(API tab)
Added PushBullet API Key Textbox to settings(API tab)
TheWizard1328 committed 9 hours ago

* Typo Code

* minor fixes
@TheWizard1328

* Update Dependencies

* Loot Gyms and disable others for dev

* Hello Appveyor

* Added visited Gym Tag Necrobot-Private/PokemonGO-Assets#24
Remove unneeded code

* fix condition

* added location change pre-start

Add the ability to double click map to change start location before
starting bot without going into settings.
**** Optional to remove later ****
Auto saved location to Config.

* Added condition according to the initiation arguments

* Simplify code

* missed into old commit

* Update to 0.69.0 needed PR Necrobot-Private/PokemonGo.RocketAPI#147
Add UseItemCapture
Added UseItemCaptureTask

* attach commit

* Add refresh to pokedex form and item rare form

* Fixes Proxy values

* Update feroxrev
cleanup

* Update assets module
  • Loading branch information
Furtif authored and Lord-Haji committed Jul 21, 2017
1 parent 158cec3 commit f85d100
Show file tree
Hide file tree
Showing 65 changed files with 1,346 additions and 561 deletions.
2 changes: 1 addition & 1 deletion FeroxRev
6 changes: 3 additions & 3 deletions KillSwitch.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
BotStatus=ENABLE;
//============================================//
POKEMON GO 0.67.2
POKEMON GO 0.69.0
//============================================//

Necrobot is now compatible with 0.67.2 API.
Necrobot is now compatible with 0.69.0 API.

//============================================//
Updated: 7/5/2017
Updated: 7/20/2017


For support/questions:
Expand Down
4 changes: 2 additions & 2 deletions PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ rmdir /s /q x64</PostBuildEvent>
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\packages\Fody.2.1.0\build\netstandard1.0\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Fody.2.1.0\build\netstandard1.0\Fody.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\Fody.2.1.2\build\netstandard1.0\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Fody.2.1.2\build\netstandard1.0\Fody.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\Selenium.WebDriver.ChromeDriver.2.30.0.1\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Selenium.WebDriver.ChromeDriver.2.30.0.1\build\Selenium.WebDriver.ChromeDriver.targets'))" />
</Target>
Expand Down Expand Up @@ -523,7 +523,7 @@ foreach (var item in filesToCleanup)
<Target Name="CleanReferenceCopyLocalPaths" AfterTargets="AfterBuild;NonWinFodyTarget">
<CosturaCleanup Config="FodyWeavers.xml" Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
</Target>
<Import Project="$(SolutionDir)\packages\Fody.2.1.0\build\netstandard1.0\Fody.targets" Condition="Exists('$(SolutionDir)\packages\Fody.2.1.0\build\netstandard1.0\Fody.targets')" />
<Import Project="$(SolutionDir)\packages\Fody.2.1.2\build\netstandard1.0\Fody.targets" Condition="Exists('$(SolutionDir)\packages\Fody.2.1.2\build\netstandard1.0\Fody.targets')" />
<Import Project="$(SolutionDir)\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets" Condition="Exists('$(SolutionDir)\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" />
<Import Project="$(SolutionDir)\packages\Selenium.WebDriver.ChromeDriver.2.30.0.1\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('$(SolutionDir)\packages\Selenium.WebDriver.ChromeDriver.2.30.0.1\build\Selenium.WebDriver.ChromeDriver.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
8 changes: 7 additions & 1 deletion PoGo.NecroBot.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using CommandLine.Text;
using PokemonGo.RocketAPI;
using System.Net.Http;
using POGOProtos.Networking.Responses;

#endregion using directives

Expand Down Expand Up @@ -424,10 +425,15 @@ public static void RunBotWithParameters(Action<ISession, StatisticsAggregator> o
var strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(4);
stats.DirtyEvent +=
() =>
Console.Title = $"[Necrobot2 v{strVersion}] " +
{
GetPlayerResponse x = _session.Client.Player.GetPlayer().Result;
string warn = x.Warn ? "*(Flagged)*-" : null;

Console.Title = $"[Necrobot2 v{strVersion}] {warn}" +
stats.GetTemplatedStats(
_session.Translation.GetTranslation(TranslationString.StatsTemplateString),
_session.Translation.GetTranslation(TranslationString.StatsXpTemplateString));
};
ProgressBar.Fill(40);

var aggregator = new StatisticsAggregator(stats);
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="AeroWizard" version="2.1.10" targetFramework="net462" />
<package id="CommandLineParser" version="1.9.71" targetFramework="net462" />
<package id="Costura.Fody" version="1.6.2" targetFramework="net462" developmentDependency="true" />
<package id="Fody" version="2.1.0" targetFramework="net462" developmentDependency="true" />
<package id="Fody" version="2.1.2" targetFramework="net462" developmentDependency="true" />
<package id="Google.Protobuf" version="3.3.0" targetFramework="net462" />
<package id="log4net" version="2.0.8" targetFramework="net462" />
<package id="Microsoft.EntityFrameworkCore" version="1.1.2" targetFramework="net462" />
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.Logic/Common/Translations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ public class Translation : ITranslation
new KeyValuePair<TranslationString, string>(TranslationString.HighestsPokemoHeader,
"====== {0} ======"),
new KeyValuePair<TranslationString, string>(TranslationString.HighestsPokemoCell,
"# CP {0,4:###0}/{1,4:###0} | ({2,6:##0.00}% {3,6:##0.00}) | Lvl: {4,2:#0} | {5}: {6,-12} | {7}: {8,-15} | {9}: {10,-15} | {11}: {12,2:#0}"),
"# CP {0}/{1} | ({2}% {3}) | Lvl: {4} | {5}: {6} | {7}: {8} | {9}: {10} | {11}: {12}"),
new KeyValuePair<TranslationString, string>(TranslationString.HumanWalkingVariant,
"Walking Speed: Has been changed, {0:n2} Km/h to {1:n2} Km/h"),
new KeyValuePair<TranslationString, string>(TranslationString.AccountBanned, "Probably Permanent Ban!"),
Expand Down
1 change: 1 addition & 0 deletions PoGo.NecroBot.Logic/Model/Settings/GymConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public GymConfig() : base()

internal enum TeamColor
{
Neutral,
Yellow,
Red,
Blue
Expand Down
18 changes: 6 additions & 12 deletions PoGo.NecroBot.Logic/MultiAccountManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ internal Account GetMinRuntime(bool ignoreBlockCheck = false)
return null;

if (ignoreBlockCheck)
return _context.Account.OrderBy(x => x.RuntimeTotal.HasValue ? x.RuntimeTotal.Value : 0).ThenBy(x => x != null ? x.Id : 0).FirstOrDefault();
return _context.Account.OrderBy(x => x.Level.Value).ThenBy(x => x.CurrentXp.Value).FirstOrDefault();
else
return _context.Account.OrderBy(x => x.RuntimeTotal.HasValue ? x.RuntimeTotal.Value : 0).ThenBy(x => x != null ? x.Id : 0).Where(x => x != null && x.ReleaseBlockTime.HasValue && x.ReleaseBlockTime.Value < DateTime.Now.ToUnixTime()).FirstOrDefault();
return _context.Account.OrderBy(x => x.Level.Value).ThenBy(x => x.CurrentXp.Value).Where(x => x != null && x.ReleaseBlockTime.HasValue && x.ReleaseBlockTime.Value < DateTime.Now.ToUnixTime()).FirstOrDefault();
}

public bool AllowMultipleBot()
Expand Down Expand Up @@ -279,8 +279,8 @@ public Account GetSwitchableAccount(Account bot = null, bool pauseIfNoSwitchable
return bot;

if (_context.Account.Count() > 0)
{
var runnableAccount = _context.Account.OrderByDescending(p => p.RuntimeTotal).ThenBy(p => p.Id).LastOrDefault(p => p != currentAccount && (!p.ReleaseBlockTime.HasValue || p.ReleaseBlockTime.HasValue && p.ReleaseBlockTime.Value < DateTime.Now.ToUnixTime()));
{
var runnableAccount = _context.Account.OrderByDescending(p => p.Level).ThenBy(p => p.CurrentXp).LastOrDefault(p => p != currentAccount && (!p.ReleaseBlockTime.HasValue || p.ReleaseBlockTime.HasValue && p.ReleaseBlockTime.Value < DateTime.Now.ToUnixTime()));

if (runnableAccount != null)
return runnableAccount;
Expand Down Expand Up @@ -369,18 +369,12 @@ public void DumpAccountList()

foreach (var item in Accounts)
{
var SP = "";
user = string.IsNullOrEmpty(item.Nickname) ? item.Username : item.Nickname;

for (int i = 0; i < maxL - user.Length + 1; i++)
{
SP += " ";
}

if (item.Level > 0)
Logger.Write($"{user}{SP}| Lvl: {item.Level:#0} | XP: {item.CurrentXp,8:0} | SD: {item.Stardust,8:0} | Runtime: {item.RuntimeTotal,3:##0} Min",LogLevel.BotStats);
Logger.Write($"{user.PadRight(maxL)} | Lvl: {item.Level,2:#0} | XP: {item.CurrentXp,8:0} | SD: {item.Stardust,8:0} | Runtime: {item.RuntimeTotal,3:##0} Min", LogLevel.BotStats);
else
Logger.Write($"{user}{SP}| Lvl: ?? | XP: | SD: 0 | Runtime: {item.RuntimeTotal,3:##0} Min", LogLevel.BotStats);
Logger.Write($"{user.PadRight(maxL)} | Lvl: ?? | XP: 0 | SD: 0 | Runtime: {item.RuntimeTotal,3:##0} Min", LogLevel.BotStats);
}
}

Expand Down
23 changes: 12 additions & 11 deletions PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@
<Reference Include="Google.Api.Gax, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3ec5ea7f18953e47, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Api.Gax.2.0.0\lib\net45\Google.Api.Gax.dll</HintPath>
</Reference>
<Reference Include="Google.Apis, Version=1.27.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.1.27.1\lib\net45\Google.Apis.dll</HintPath>
<Reference Include="Google.Apis, Version=1.28.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.1.28.0\lib\net45\Google.Apis.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Analytics.v3, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SolutionDir)\packages\Google.Apis.Analytics.v3.1.0.2\lib\net45\Google.Apis.Analytics.v3.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth, Version=1.27.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.Auth.1.27.1\lib\net45\Google.Apis.Auth.dll</HintPath>
<Reference Include="Google.Apis.Auth, Version=1.28.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.Auth.1.28.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.27.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.Auth.1.27.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.28.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.Auth.1.28.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core, Version=1.27.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.Core.1.27.1\lib\net45\Google.Apis.Core.dll</HintPath>
<Reference Include="Google.Apis.Core, Version=1.28.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.Core.1.28.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.PlatformServices, Version=1.27.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.1.27.1\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
<Reference Include="Google.Apis.PlatformServices, Version=1.28.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Apis.1.28.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf, Version=3.3.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Google.Protobuf.3.3.0\lib\net45\Google.Protobuf.dll</HintPath>
Expand Down Expand Up @@ -170,7 +170,7 @@
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json.Schema, Version=3.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.Schema.3.0.1\lib\net45\Newtonsoft.Json.Schema.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.Schema.3.0.2\lib\net45\Newtonsoft.Json.Schema.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq, Version=2.1.0.0, Culture=neutral, PublicKeyToken=fee00910d6e5f53b, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Remotion.Linq.2.1.2\lib\net45\Remotion.Linq.dll</HintPath>
Expand Down Expand Up @@ -683,6 +683,7 @@
<Compile Include="Tasks\UseLuckyEggConstantlyTask.cs" />
<Compile Include="Tasks\UseLuckyEggTask.cs" />
<Compile Include="Tasks\UseNearbyPokestopsTask.cs" />
<Compile Include="Tasks\UseItemCaptureTask.cs" />
<Compile Include="TinyIoC.cs" />
<Compile Include="Utils\AsyncLock.cs" />
<Compile Include="Utils\DelayingUtils.cs" />
Expand Down
16 changes: 8 additions & 8 deletions PoGo.NecroBot.Logic/Service/ConsoleEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,19 +506,19 @@ private static void HandleEvent(DisplayHighestsPokemonEvent displayHighestsPokem
Logger.Write(
session.Translation.GetTranslation(
TranslationString.HighestsPokemoCell,
pokemon.Item1.Cp.ToString(), //.PadLeft(4, ' '),
pokemon.Item2.ToString(), //.PadLeft(4, ' '),
pokemon.Item3.ToString("0.00"),
pokemon.Item1.Cp.ToString().PadLeft(4, ' '),
pokemon.Item2.ToString().PadLeft(4, ' '),
pokemon.Item3.ToString("0.00").PadRight(6, ' '),
strPerfect,
pokemon.Item4.ToString("00"),
pokemon.Item4.ToString("00").PadRight(2, ' '),
strName,
session.Translation.GetPokemonTranslation(pokemon.Item1.PokemonId), //.PadRight(12, ' '),
session.Translation.GetPokemonTranslation(pokemon.Item1.PokemonId).PadRight(12, ' '),
move1,
strMove1, //.PadRight(15, ' '),
strMove1.PadRight(16, ' '),
move2,
strMove2, //.PadRight(15, ' '),
strMove2.PadRight(16, ' '),
candy,
pokemon.Item7
pokemon.Item7.ToString("00").PadRight(2, ' ')
),
LogLevel.Info,
ConsoleColor.Yellow
Expand Down
4 changes: 3 additions & 1 deletion PoGo.NecroBot.Logic/State/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,16 @@ public bool ReInitSessionWithNextBot(Account bot = null, double lat = 0, double
if (XP == null) { XP = 0; }
long? SD = nextBot.Stardust;
if (SD == null) { SD = 0; }
long? Lvl = nextBot.Level;
if (Lvl == null) { Lvl = 0; }
var NLevelXP = nextBot.NextLevelXp;
if (nextBot.NextLevelXp == null) { NLevelXP = 0; }

Logger.Write($"Account changed to {Account}", LogLevel.BotStats);

if (session.LogicSettings.NotificationConfig.EnablePushBulletNotification == true)
PushNotificationClient.SendNotification(session, $"Account changed to", $"{Account}\n" +
$"Lvl: {nextBot.Level}\n" +
$"Lvl: {Lvl}\n" +
$"XP : {XP:#,##0}({(double)XP / ((double)NLevelXP) * 100:#0.00}%)\n" +
$"SD : {SD:#,##0}\n", true).ConfigureAwait(false);

Expand Down
4 changes: 2 additions & 2 deletions PoGo.NecroBot.Logic/State/StateMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ public async Task Start(IState initialState, ISession session, string subPath, b
session.EventDispatcher.Send(new WarnEvent { Message = $"Detected a good pokemon with snipe {rsae.EncounterData.PokemonId.ToString()} IV:{rsae.EncounterData.IV} Move:{rsae.EncounterData.Move1}/ Move:{rsae.EncounterData.Move2} LV: Move:{rsae.EncounterData.Level}" });
else
{
session.EventDispatcher.Send(new WarnEvent { Message = "Encountered a good pokemon, switch another bot to catch him too." });
session.EventDispatcher.Send(new WarnEvent { Message = "Encountered a good pokemon, switch bots to catch him too." });
if (session.LogicSettings.NotificationConfig.EnablePushBulletNotification == true)
await PushNotificationClient.SendNotification(session, $"Switch bot account", $"Encountered a good pokemon, switch another bot to catch him too.", true).ConfigureAwait(false);
await PushNotificationClient.SendNotification(session, $"Switch bot account", $"Encountered a good pokemon, switch bots to catch him too.", true).ConfigureAwait(false);
}
session.ReInitSessionWithNextBot(rsae.Bot, session.Client.CurrentLatitude, session.Client.CurrentLongitude, session.Client.CurrentAltitude);
state = new LoginState(rsae.LastEncounterPokemonId, rsae.EncounterData);
Expand Down
10 changes: 10 additions & 0 deletions PoGo.NecroBot.Logic/Tasks/UseGymBattleTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ public static async Task<bool> Execute(ISession session, CancellationToken cance
{
if (!session.LogicSettings.GymConfig.Enable || gym.Type != FortType.Gym) return false;

Logger.Write($"Loot Gym: {fortInfo.Name}, Description: {fortInfo.Description}", LogLevel.Gym);
await UseNearbyPokestopsTask.FarmPokestop(session, gym, fortInfo, cancellationToken, true).ConfigureAwait(false);

//disable other for dev
if (gym != null) return false;
//

if (session.GymState.MoveSettings == null)
{
session.GymState.MoveSettings = await session.Inventory.GetMoveSettings().ConfigureAwait(false);
Expand Down Expand Up @@ -1387,6 +1394,9 @@ internal static bool CanTrainGym(ISession session, FortData fort, IEnumerable<Po
FortData = fort
};

if (session.Profile.PlayerData.Team == TeamColor.Neutral)
return false;

GymGetInfoResponse gymDetails = session.GymState.GetGymDetails(session, fort);
if (session.GymState.CapturedGymId.Equals(fort.Id) && _fortstate.FortData.OwnedByTeam != session.Profile.PlayerData.Team)
gymDetails = session.GymState.GetGymDetails(session, fort, true);
Expand Down
19 changes: 19 additions & 0 deletions PoGo.NecroBot.Logic/Tasks/UseItemCaptureTask.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Threading.Tasks;
using PoGo.NecroBot.Logic.Logging;
using PoGo.NecroBot.Logic.State;
using POGOProtos.Inventory.Item;
using POGOProtos.Networking.Responses;
using POGOProtos.Map.Fort;

namespace PoGo.NecroBot.Logic.Tasks
{
public class UseItemCaptureTask
{
public static async Task Execute(ISession session, ItemId itemid, ulong encounterid, string spawnpointid)
{
Logger.Write($"Use {itemid.ToString()}", LogLevel.Recycling);
await session.Client.Inventory.UseItemCapture(itemid, encounterid, spawnpointid).ConfigureAwait(false);
}
}
}
Loading

0 comments on commit f85d100

Please sign in to comment.