コード例 #1
0
ファイル: BotClient.cs プロジェクト: tranbaquanthuy/pporise
        public void Update()
        {
            AutoReconnector.Update();
            CallInvokes();
            if (Game is null)
            {
                return;
            }

            if (Running != State.Started)
            {
                return;
            }

            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }
            if (MiningAI != null)
            {
                if (MiningAI.Update())
                {
                    return;
                }
            }

            if (Game.IsInactive && Game.IsMapLoaded && Game.IsConnected)
            {
                ExecuteNextAction();
            }
        }
コード例 #2
0
ファイル: BotClient.cs プロジェクト: MeltWS/proshine
        public void Update()
        {
            AutoReconnector.Update();

            if (_loginRequested)
            {
                LoginUpdate();
                _loginRequested = false;
                return;
            }

            if (Running != State.Started)
            {
                return;
            }

            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }

            if (Game.IsMapLoaded && Game.AreNpcReceived && Game.IsInactive)
            {
                ExecuteNextAction();
            }
        }
コード例 #3
0
ファイル: BotClient.cs プロジェクト: IamSanjid/pokeone-pluse
        public void Update()
        {
            if (_loginRequested)
            {
                LoginUpdate();
                _loginRequested = false;
                return;
            }

            if (Game != null && Game.IsInBattle && Game.IsInactive && AI != null && AI.UseMandatoryAction())
            {
                return;
            }

            AutoReconnector.Update();
            AutoLootBoxOpener.Update();
            QuestManager.Update();

            if (_npcBattler != null && Game.DistanceFrom(_npcBattler.PositionX, _npcBattler.PositionY) > 1 &&
                Game != null && Game.IsMapLoaded && Game.IsInactive && !Game.IsInBattle)
            {
                Game.ClearPath();
                MoveToCell(_npcBattler.PositionX, _npcBattler.PositionY, 1);
                _npcBattler = null;
                return;
            }
            if (_npcBattler != null && Game != null && Game?.DistanceFrom(_npcBattler.PositionX, _npcBattler.PositionY) <= 1)
            {
                _npcBattler = null;
            }

            if (Script?.IsLoaded == true)
            {
                Script?.Update();
            }

            if (Running != State.Started)
            {
                return;
            }

            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }
            if (AI != null && AI.IsBusy)
            {
                return;
            }

            if (Game.IsMapLoaded && Game.AreNpcReceived && Game.IsInactive)
            {
                ExecuteNextAction();
            }
        }
コード例 #4
0
        public void Update()
        {
            if (Script != null)
            {
                Script.Update();
            }

            if (_teleportCheckRequested)
            {
                if (TeleportationCheck < DateTime.UtcNow)
                {
                    if (!Game.IsInBattle)
                    {
                        PlayShoutNotification?.Invoke();
                        PauseScript(5.5f);
                        LogMessage("Bot got teleported twice or more than twice please check. This can be a GM/Admin/Mod teleport.", Brushes.OrangeRed);
                        countGMTele = 0;
                    }
                    _teleportCheckRequested = false;
                }
            }
            CallInvokes();
            AutoReconnector.Update();

            if (_loginRequested)
            {
                LoginUpdate();
                _loginRequested = false;
                return;
            }
            if (StartScriptInstant && Running != State.Started && Game != null & Script != null)
            {
                if (Game.IsMapLoaded && Game.AreNpcReceived && Game.IsInactive)
                {
                    Start();
                    StartScriptInstant = false;
                }
            }

            if (Running != State.Started)
            {
                return;
            }
            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }

            if (Game.IsMapLoaded && Game.AreNpcReceived && Game.IsInactive)
            {
                ExecuteNextAction();
            }
        }
コード例 #5
0
        public void Update()
        {
            if (_loginRequested)
            {
                LoginUpdate();
                _loginRequested = false;
                return;
            }

            AutoReconnector.Update();
            AutoLootBoxOpener.Update();
            QuestManager.Update();

            if (_npcBattler != null && Game != null && Game.IsMapLoaded && Game.IsInactive)
            {
                if (GameClient.DistanceBetween(Game.PlayerX, Game.PlayerY, _npcBattler.PositionX, _npcBattler.PositionY) == 1)
                {
                    TalkToNpc(_npcBattler);
                    _npcBattler = null;
                }
                else
                {
                    TalkToNpc(_npcBattler);
                }
                return;
            }

            if (Script?.IsLoaded == true)
            {
                Script?.Update();
            }

            if (Running != State.Started)
            {
                return;
            }

            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }
            if (AI != null && AI.IsBusy)
            {
                return;
            }

            if (Game.IsMapLoaded && Game.AreNpcReceived && Game.IsInactive)
            {
                ExecuteNextAction();
            }
        }
コード例 #6
0
        public void Update()
        {
            if (_authenticationRequired)
            {
                if (Encryption.StateReady)
                {
                    // TODO: Add an option to select the OS we want, it could be useful.
                    Game.SendAuthentication(Account.Name,
                                            Account.Password,
                                            Account.DeviceId ?? Hardware.GenerateRandomHash(),
                                            Hardware.GenerateRandomOsInfo());
                    _authenticationRequired = false;
                }
                return;
            }
            AutoReconnector.Update();

            if (_loginRequested)
            {
                LoginUpdate();
                _loginRequested = false;
                return;
            }

            if (Game != null && Game.IsInBattle && Game.IsInactive && AI != null && AI.UseMandatoryAction())
            {
                return;
            }

            if (Running != State.Started)
            {
                return;
            }

            if (Game.IsCreatingNewCharacter)
            {
                LogMessage("Creating a new character with a random skin...");
                Game.CreateCharacter(Rand.Next(14), Rand.Next(28), Rand.Next(4), 695 + Rand.Next(6), Rand.Next(5));
                return;
            }

            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }

            if (Game.IsMapLoaded && Game.AreNpcReceived && Game.IsInactive)
            {
                ExecuteNextAction();
            }
        }
コード例 #7
0
ファイル: BotClient.cs プロジェクト: deilkaserlend/pporise
        public void Update()
        {
            AutoReconnector.Update();
            CallInvokes();

            if (_loginRequested)
            {
                _loginRequested = false;
                LoginUpdate();
                return;
            }

            if (Game is null)
            {
                return;
            }

            if (Game.IsCreatingCharacter)
            {
                C_LogMessage("Creating a new character with a random skin...", Brushes.OrangeRed);
                Game.CreateCharacter();
                return;
            }

            if (Running != State.Started)
            {
                return;
            }

            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }
            if (MiningAI?.Update() == true)
            {
                return;
            }

            if (Game.IsMapLoaded && Game.IsConnected && Game.IsInactive)
            {
                ExecuteNextAction();
            }
        }
コード例 #8
0
ファイル: BotClient.cs プロジェクト: tranbaquanthuy/proshine
        public void Update()
        {
            AutoReconnector.Update();

            if (_loginRequested)
            {
                LoginUpdate();
                _loginRequested = false;
                return;
            }

            if (Game != null && Game.IsInBattle && Game.IsInactive && AI != null && AI.UseMandatoryAction())
            {
                return;
            }

            if (Running != State.Started)
            {
                return;
            }

            if (Game.IsCreatingNewCharacter)
            {
                LogMessage("Creating a new character with a random skin...");
                Game.CreateCharacter(Rand.Next(14), Rand.Next(28), Rand.Next(8), Rand.Next(6), Rand.Next(5));
                return;
            }

            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }

            if (Game.IsMapLoaded && Game.AreNpcReceived && Game.IsInactive)
            {
                ExecuteNextAction();
            }
        }
コード例 #9
0
        public void Update()
        {
            AutoReconnector.Update();
            CallInvokes();
            if (Game is null)
            {
                return;
            }
            if (_loginUpdate && _gameConnection.IsLoggedInToWebsite)
            {
                _loginUpdate = false;
                LoginUpdate();
            }

            if (Running != State.Started)
            {
                return;
            }

            if (PokemonEvolver.Update())
            {
                return;
            }
            if (MoveTeacher.Update())
            {
                return;
            }
            if (MiningAI != null)
            {
                if (MiningAI.Update())
                {
                    return;
                }
            }

            if (Game.IsInactive && Game.IsMapLoaded && Game.IsConnected)
            {
                ExecuteNextAction();
            }
        }