Exemplo n.º 1
0
        private void Client_TeleportationOccuring(string map, int x, int y)
        {
            string message = "Position updated: [" + map + "] (" + x + ", " + y + ")";

            if (Game.Map == null || Game.IsTeleporting)
            {
                message += " [OK]";
            }
            else if (Game.MapName != map)
            {
                message += " [WARNING, different map] /!\\";
                Script?.OnWarningMessage(true);
            }
            else
            {
                int distance = GameClient.DistanceBetween(x, y, Game.PlayerX, Game.PlayerY);
                if (distance < 8)
                {
                    message += " [OK, lag, distance=" + distance + "]";
                }
                else
                {
                    message += " [WARNING, distance=" + distance + "] /!\\";
                    Script?.OnWarningMessage(false, distance);
                }
                Script?.OnMovementLag(distance);
            }

            if (message.Contains("OK"))
            {
                LogMessage(message, Brushes.LimeGreen);
            }
            if (message.Contains("WARNING"))
            {
                LogMessage(message, Brushes.OrangeRed);
            }

            MovementResynchronizer.Reset();
        }
Exemplo n.º 2
0
        private void Client_TeleportationOccuring(string map, int x, int y)
        {
            string message = "Position updated: " + map + " (" + x + ", " + y + ")";

            if (Game.Map == null || Game.IsTeleporting)
            {
                message += " [OK]";
            }
            else if (Game.MapName != map)
            {
                Script.OnWarningMessage(true, Game.MapName);
                message += " [WARNING, different map] /!\\";
                bool flagTele        = map.ToLowerInvariant().Contains("pokecenter") ? false : true;
                bool anotherFlagTele = map.ToLowerInvariant().Contains("player") ? false : true;
                if (flagTele && anotherFlagTele && Game.PreviousMapBeforeTeleport != Game.MapName && countGMTele >= 2)
                {
                    if (BeAwareOfStaff)
                    {
                        NeedResync = true;
                    }
                    PlayShoutNotification?.Invoke();
                    countGMTele = 0;
                }
                else if (Game.MapName.ToLowerInvariant().Contains("prof. antibans classroom"))
                {
                    LogMessage("Bot got teleported to an unexpected Map, please check. This can be a GM/Admin/Mod teleport.");
                    PlayShoutNotification?.Invoke();
                    if (BeAwareOfStaff)
                    {
                        NeedResync = true;
                    }
                }
            }
            else
            {
                int distance = GameClient.DistanceBetween(x, y, Game.PlayerX, Game.PlayerY);
                if (distance < 8)
                {
                    message += " [OK, lag, distance=" + distance + "]";
                }
                else
                {
                    Script.OnWarningMessage(false, string.Empty, distance);
                    message += " [WARNING, distance=" + distance + "] /!\\";
                    countGMTele++;
                    if (countGMTele > 2)
                    {
                        CheckTeleportion(1f);
                    }
                }
            }
            if (message.Contains("[OK]"))
            {
                LogMessage(message);
            }
            if (message.Contains("WARNING"))
            {
                LogMessage(message);
            }
            MovementResynchronizer.Reset();
        }