public override void OnPlayerJoin(VRCPlayerApi player)
        {
            var _player = GeneralWrappers.GetPlayerManager().GetPlayer(player);

            if (_player == null)
            {
                return;
            }
            var apiuser = _player.GetAPIUser();

            if (apiuser == null)
            {
                return;
            }

            if (GeneralUtils.Authorities.TryGetValue(apiuser.id, out string what))
            {
                //im gonna use the what for later ok
                player.SetNamePlateColor(Color.cyan);
                ConsoleUtil.Info($"An Ethos Admin+ || {apiuser.displayName} has joined.");
            }

            if (GeneralUtils.CantHearOnNonFriends)
            {
                if (!APIUser.IsFriendsWith(apiuser.id))
                {
                    _player.GetVRCPlayer().field_Internal_Boolean_3 = false;
                }
            }

            if (Configuration.GetConfig().LogModerations)
            {
                GeneralUtils.InformHudText(Color.green, $"{apiuser.displayName} has joined.");
            }

            if (GeneralUtils.ESP)
            {
                GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].transform.Find("SelectRegion"))
                    {
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.SetColor("_Color", Color.red);
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta);
                        GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
                    }
                }
            }
        }
        public override void OnUpdate()
        {
            try
            {
                if (StoredKeybinds.Count() == 0)
                {
                    StoredKeybinds.AddRange(Configuration.GetConfig().Keybinds);
                }

                foreach (var keybind in StoredKeybinds)
                {
                    if (Input.GetKey(keybind.FirstKey) && Input.GetKeyDown(keybind.SecondKey))
                    {
                        switch (keybind.Target)
                        {
                        default:
                            break;

                        case EthosFeature.Flight:
                            GeneralUtils.Flight = !GeneralUtils.Flight;
                            Physics.gravity     = GeneralUtils.Flight ? Vector3.zero : GeneralUtils.SavedGravity;
                            GeneralUtils.ToggleColliders(!GeneralUtils.Flight);
                            break;

                        case EthosFeature.ESP:
                            GeneralUtils.ESP = !GeneralUtils.ESP;
                            GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
                            for (int i = 0; i < array.Length; i++)
                            {
                                if (array[i].transform.Find("SelectRegion"))
                                {
                                    array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.color       = Color.green;
                                    array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.color = Color.red;
                                    GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
                                }
                            }
                            foreach (VRCSDK2.VRC_Interactable vrc_Interactable in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Interactable>())
                            {
                                GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Interactable.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                            }
                            foreach (VRCSDK2.VRC_Pickup vrc_Pickup in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Pickup>())
                            {
                                GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Pickup.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                            }
                            foreach (PortalInternal portalInternal in Resources.FindObjectsOfTypeAll <PortalInternal>())
                            {
                                GeneralWrappers.GetHighlightsFX().EnableOutline(portalInternal.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                            }
                            break;

                        case EthosFeature.Autism:
                            GeneralUtils.Autism = !GeneralUtils.Autism;
                            break;

                        case EthosFeature.SpinBot:
                            GeneralUtils.SpinBot = !GeneralUtils.SpinBot;
                            break;

                        case EthosFeature.WorldTriggers:
                            GeneralUtils.WorldTriggers = !GeneralUtils.WorldTriggers;
                            break;

                        case EthosFeature.ToggleAllTriggers:
                            foreach (VRC_Trigger trigger in Resources.FindObjectsOfTypeAll <VRC_Trigger>())
                            {
                                if (!trigger.name.Contains("Avatar") && !trigger.name.Contains("Chair"))
                                {
                                    trigger.Interact();
                                }
                            }
                            break;

                        case EthosFeature.AntiWorldTriggers:
                            Configuration.GetConfig().AntiWorldTriggers = !Configuration.GetConfig().AntiWorldTriggers;
                            Configuration.SaveConfiguration();
                            break;
                        }
                    }
                }

                if (GeneralUtils.AutoDeleteEveryonesPortals)
                {
                    if (Resources.FindObjectsOfTypeAll <PortalInternal>().Count() > 0)
                    {
                        foreach (var portal in Resources.FindObjectsOfTypeAll <PortalInternal>())
                        {
                            UnityEngine.Object.Destroy(portal.gameObject);
                        }
                    }
                }

                if (GeneralUtils.AutoDeleteNonFriendsPortals)
                {
                    if (Resources.FindObjectsOfTypeAll <PortalInternal>().Count() > 0)
                    {
                        foreach (var portal in Resources.FindObjectsOfTypeAll <PortalInternal>())
                        {
                            var player = portal.GetPlayer();
                            if (player.GetAPIUser() != null)
                            {
                                if (!APIUser.IsFriendsWith(player.GetAPIUser().id))
                                {
                                    UnityEngine.Object.Destroy(portal.gameObject);
                                }
                            }
                        }
                    }
                }

                if (GeneralUtils.AutoDeleteAllPickups)
                {
                    if (Resources.FindObjectsOfTypeAll <VRC_Pickup>().Count() > 0)
                    {
                        foreach (var pickup in Resources.FindObjectsOfTypeAll <VRC_Pickup>())
                        {
                            UnityEngine.Object.Destroy(pickup.gameObject);
                        }
                    }
                }

                if (GeneralUtils.SpinBot)
                {
                    PlayerWrappers.GetVRC_Player(GeneralWrappers.GetPlayerManager().GetCurrentPlayer()).gameObject.transform.Rotate(0f, 20f, 0f);
                }

                if (GeneralUtils.InfiniteJump)
                {
                    if (VRCInputManager.Method_Public_Static_ObjectPublicStSiBoSiObBoSiObStSiUnique_String_0("Jump").prop_Boolean_0)
                    {
                        GeneralWrappers.GetPlayerManager().GetCurrentPlayer().GetComponent <VRCMotionState>().field_Private_Boolean_0 = true;
                    }
                }

                if (GeneralUtils.Autism)
                {
                    var randomPlr = PlayerWrappers.GetAllPlayers(GeneralWrappers.GetPlayerManager())[new System.Random().Next(0, PlayerWrappers.GetAllPlayers(GeneralWrappers.GetPlayerManager()).Count())];
                    PlayerWrappers.GetVRC_Player(GeneralWrappers.GetPlayerManager().GetCurrentPlayer()).gameObject.transform.position = randomPlr.transform.position;
                }

                if (GeneralUtils.Flight)
                {
                    GameObject gameObject   = GeneralWrappers.GetPlayerCamera();
                    var        currentSpeed = (Input.GetKey(KeyCode.LeftShift) ? 16f : 8f);
                    var        player       = GeneralWrappers.GetPlayerManager().GetCurrentPlayer();

                    if (Input.GetKey(KeyCode.W))
                    {
                        player.transform.position += gameObject.transform.forward * currentSpeed * Time.deltaTime;
                    }

                    if (Input.GetKey(KeyCode.A))
                    {
                        player.transform.position += player.transform.right * -1f * currentSpeed * Time.deltaTime;
                    }

                    if (Input.GetKey(KeyCode.S))
                    {
                        player.transform.position += gameObject.transform.forward * -1f * currentSpeed * Time.deltaTime;
                    }

                    if (Input.GetKey(KeyCode.D))
                    {
                        player.transform.position += player.transform.right * currentSpeed * Time.deltaTime;
                    }

                    if (Input.GetKey(KeyCode.Space))
                    {
                        player.transform.position += player.transform.up * currentSpeed * Time.deltaTime;
                    }

                    if (Math.Abs(Input.GetAxis("Joy1 Axis 2")) > 0f)
                    {
                        player.transform.position += gameObject.transform.forward * currentSpeed * Time.deltaTime * (Input.GetAxis("Joy1 Axis 2") * -1f);
                    }

                    if (Math.Abs(Input.GetAxis("Joy1 Axis 1")) > 0f)
                    {
                        player.transform.position += gameObject.transform.right * currentSpeed * Time.deltaTime * Input.GetAxis("Joy1 Axis 1");
                    }
                }
            }
            catch (Exception) { }
        }
Beispiel #3
0
 public UtilsVRMenu(QMNestedButton parent) : base(parent, 1, 1, "Utils", "Extended utilities you can use to manage the game better", Color.red, Color.white, Color.red, Color.cyan)
 {
     new QMToggleButton(this, 1, 0, "Enable\nFlight", delegate
     {
         Physics.gravity     = Vector3.zero;
         GeneralUtils.Flight = true;
         GeneralUtils.ToggleColliders(!GeneralUtils.Flight);
     }, "Disable\nFlight", delegate
     {
         Physics.gravity     = GeneralUtils.SavedGravity;
         GeneralUtils.Flight = false;
         GeneralUtils.ToggleColliders(!GeneralUtils.Flight);
     }, "Toggle Flight and move around within the air with ease!", Color.red, Color.white).setToggleState(GeneralUtils.Flight);
     new QMToggleButton(this, 2, 0, "Enable\nESP", delegate
     {
         GeneralUtils.ESP   = true;
         GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
         for (int i = 0; i < array.Length; i++)
         {
             if (array[i].transform.Find("SelectRegion"))
             {
                 array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.SetColor("_Color", Color.red);
                 array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta);
                 GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
             }
         }
     }, "Disable\nESP", delegate
     {
         GeneralUtils.ESP   = false;
         GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
         for (int i = 0; i < array.Length; i++)
         {
             if (array[i].transform.Find("SelectRegion"))
             {
                 array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.SetColor("_Color", Color.red);
                 array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta);
                 GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
             }
         }
     }, "Decide whether you want the upper game, get an advantage, and see all players anywhere within the world.", Color.red, Color.white).setToggleState(GeneralUtils.ESP);
     new QMSingleButton(this, 3, 0, "Avatar\nBy\nID", delegate
     {
         ConsoleUtil.Info("Enter Avatar ID: ");
         string ID = Console.ReadLine();
         VRC.Core.API.SendRequest($"avatars/{ID}", VRC.Core.BestHTTP.HTTPMethods.Get, new ApiModelContainer <ApiAvatar>(), null, true, true, 3600f, 2, null);
         new PageAvatar
         {
             avatar = new SimpleAvatarPedestal
             {
                 field_Internal_ApiAvatar_0 = new ApiAvatar
                 {
                     id = ID
                 }
             }
         }.ChangeToSelectedAvatar();
         GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully cloned that avatar by It's Avatar ID.</color>");
     }, "Sets your current avatar using an avatar ID.", Color.red, Color.white);
     new QMSingleButton(this, 4, 0, "Join\nBy\nID", delegate
     {
         ConsoleUtil.Info("Enter Instance ID: ");
         string ID = Console.ReadLine();
         Networking.GoToRoom(ID);
     }, "Joins an instance by It's ID.", Color.red, Color.white);
 }
        public override void OnPlayerJoin(VRCPlayerApi player)
        {
            var _player = GeneralWrappers.GetPlayerManager().GetPlayer(player);

            if (_player == null)
            {
                return;
            }

            var apiuser = _player.GetAPIUser();

            if (apiuser == null)
            {
                return;
            }

            if (GeneralUtils.Authorities.TryGetValue(apiuser.id, out string what))
            {
                //im gonna use the what for later ok
                player.SetNamePlateColor(Color.cyan);
                ConsoleUtil.Info($"A Client admin || {apiuser.displayName} has joined.");
            }

            if (GeneralUtils.CantHearOnNonFriends)
            {
                if (!APIUser.IsFriendsWith(apiuser.id))
                {
                    _player.GetVRCPlayer().field_Internal_Boolean_3 = false;
                }
            }

            if (Configuration.GetConfig().LogModerations)
            {
                GeneralUtils.InformHudText(Color.green, $"{apiuser.displayName} has joined.");
            }

            if (Configuration.GetConfig().AntiPhotonBot)
            {
                if (_player.GetAPIUser().statusIsSetToOffline&& _player.GetVRCPlayer().prop_Int16_0 == 0)
                {
                    //most likely photon bot lol, they're offline on the api and their ping is spoofed to 0, this is suspicious as f**k ok
                    GeneralUtils.InformHudText(Color.red, $"{_player.GetAPIUser().displayName} is detected as a photon bot\n User is now removed !");
                    UnityEngine.Object.Destroy(_player.GetVRCPlayer().gameObject);
                    UnityEngine.Object.Destroy(_player.gameObject);
                }
            }

            if (GeneralUtils.DestroyUSpeakOnPlayerJoin)
            {
                UnityEngine.Object.Destroy(_player.GetVRCPlayer().GetUSpeaker().gameObject);
            }

            if (GeneralUtils.ESP)
            {
                GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].transform.Find("SelectRegion"))
                    {
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.SetColor("_Color", Color.red);
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta);
                        GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
                    }
                }
            }
        }
Beispiel #5
0
        public UtilsVRMenu(QMNestedButton parent, EthosVRButton config) : base(parent, config.X, config.Y, config.Name, config.Tooltip, GeneralUtils.GetColor(config.ColorScheme.Colors[0]), GeneralUtils.GetColor(config.ColorScheme.Colors[1]), GeneralUtils.GetColor(config.ColorScheme.Colors[2]), GeneralUtils.GetColor(config.ColorScheme.Colors[3]))
        {
            new QMToggleButton(this, 1, 0, "Enable\nESP", delegate
            {
                GeneralUtils.ESP   = true;
                GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].transform.Find("SelectRegion"))
                    {
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.color       = Color.green;
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.color = Color.red;
                        GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
                    }
                }

                foreach (VRCSDK2.VRC_Interactable vrc_Interactable in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Interactable>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Interactable.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }

                foreach (VRCSDK2.VRC_Pickup vrc_Pickup in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Pickup>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Pickup.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }

                foreach (PortalInternal portalInternal in Resources.FindObjectsOfTypeAll <PortalInternal>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(portalInternal.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }
            }, "Disable\nESP", delegate
            {
                GeneralUtils.ESP   = false;
                GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].transform.Find("SelectRegion"))
                    {
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.color       = Color.green;
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.color = Color.red;
                        GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
                    }
                }

                foreach (VRCSDK2.VRC_Interactable vrc_Interactable in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Interactable>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Interactable.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }

                foreach (VRCSDK2.VRC_Pickup vrc_Pickup in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Pickup>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Pickup.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }

                foreach (PortalInternal portalInternal in Resources.FindObjectsOfTypeAll <PortalInternal>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(portalInternal.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }
            }, "Decide whether you want the upper game, get an advantage, and see all players anywhere within the world.", Color.red, Color.white).setToggleState(GeneralUtils.ESP);

            new QMSingleButton(this, 2, 0, "Avatar\nBy\nID", delegate
            {
                ConsoleUtil.Info("Enter Avatar ID: ");
                string ID = Console.ReadLine();
                VRC.Core.API.SendRequest($"avatars/{ID}", VRC.Core.BestHTTP.HTTPMethods.Get, new ApiModelContainer <ApiAvatar>(), null, true, true, 3600f, 2, null);
                new PageAvatar
                {
                    avatar = new SimpleAvatarPedestal
                    {
                        field_Internal_ApiAvatar_0 = new ApiAvatar
                        {
                            id = ID
                        }
                    }
                }.ChangeToSelectedAvatar();
                GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully cloned that avatar by It's Avatar ID.</color>");
            }, "Sets your current avatar using an avatar ID.", Color.red, Color.white);

            new QMSingleButton(this, 3, 0, "Join\nBy\nID", delegate
            {
                ConsoleUtil.Info("Enter Instance ID: ");
                string ID = Console.ReadLine();
                Networking.GoToRoom(ID);
            }, "Joins an instance by It's ID.", Color.red, Color.white);

            new QMSingleButton(this, 4, 0, "Copy\nRoom\nID", delegate
            {
                Clipboard.SetText($"{RoomManagerBase.field_Internal_Static_ApiWorld_0.id}:{RoomManagerBase.field_Internal_Static_ApiWorld_0.instanceId}");
            }, "Copies the current instance's ID.", Color.red, Color.white);

            new QMToggleButton(this, 1, 1, "Can't Hear\non Non Friends", delegate
            {
                GeneralUtils.CantHearOnNonFriends = true;
                foreach (var player in GeneralWrappers.GetPlayerManager().GetAllPlayers())
                {
                    if (!APIUser.IsFriendsWith(player.GetAPIUser().id))
                    {
                        player.GetVRCPlayer().field_Internal_Boolean_3 = false;
                    }
                }
            }, "Can Hear\non Non Friends", delegate
            {
                GeneralUtils.CantHearOnNonFriends = false;
                foreach (var player in GeneralWrappers.GetPlayerManager().GetAllPlayers())
                {
                    if (!APIUser.IsFriendsWith(player.GetAPIUser().id))
                    {
                        player.GetVRCPlayer().field_Internal_Boolean_3 = true;
                    }
                }
            }, "Decide whether you want your friends to only hear you in game or not.", Color.red, Color.white).setToggleState(GeneralUtils.CantHearOnNonFriends);

            //new QMToggleButton(this, 2, 1, "Invisible\nOn", delegate
            //{
            //    GeneralUtils.Invisible = true;
            //}, "Invisible\nOff", delegate
            //{
            //    GeneralUtils.Invisible = false;
            //}, "Decide whether you want people to see you in game.", Color.red, Color.white).setToggleState(GeneralUtils.Invisible);
        }