Exemplo n.º 1
0
        private void runCommand(string commandMessage)
        {
            Plugin.Log("Running commandMessage: " + commandMessage, Plugin.LogLevel.Debug);

            if (String.IsNullOrEmpty(commandMessage))
            {
                Plugin.Log("Command was null!", Plugin.LogLevel.Error);
                return;
            }

            string[] args    = commandMessage.Split(null);
            string   command = args[0];

            if (command.Equals("help"))
            {
                twitch.SendChatMessage(Consts.HELP_INFO);
                sendListOfValidCommands();
            }
            else if (command.Equals("move"))
            {
                if (args.Length < 5)
                {
                    Plugin.Log("Invalid args for command " + command, Plugin.LogLevel.Info);
                    twitch.SendChatMessage("USAGE: !move name x y z");
                    twitch.SendChatMessage("EXAMPLE: !move cam 2 0 1");
                    return;
                }

                string objectToMove = null;
                float  xPos;
                float  yPos;
                float  zPos;

                // Example
                // !move cam 100 100 100
                try
                {
                    objectToMove = args[1].ToLower();
                    xPos         = float.Parse(args[2]);
                    yPos         = float.Parse(args[3]);
                    zPos         = float.Parse(args[4]);
                }
                catch
                {
                    Plugin.Log("Error parsing commands! Format should be {command object float float float}: " + command, Plugin.LogLevel.Info);
                    twitch.SendChatMessage("USAGE: !move name x y z");
                    twitch.SendChatMessage("EXAMPLE: !move cam 2 0 1");
                    return;
                }

                if (objectToMove.Equals("cam") || objectToMove.Equals("camera"))
                {
                    CameraMover.Instance.moveCamera(xPos, yPos, zPos);
                }
                else
                {
                    Plugin.Log("Invalid object name for command: " + command, Plugin.LogLevel.Info);
                    sendListOfValidObjects();
                    return;
                }
            }
            else
            {
                Plugin.Log("Invalid command: " + command, Plugin.LogLevel.Info);
                //sendListOfValidCommands();
                return;
            }
        }
Exemplo n.º 2
0
 private void TwitchConnection_OnChatJoined(TwitchConnection arg1)
 {
     Plugin.Log("Message Recieved, AsyncTwitch currently working", Plugin.LogLevel.Debug);
     arg1.SendChatMessage("Custom UI plugin connected! Type !help for info!");
 }