コード例 #1
0
        // Input loop for adding bots, sending global messages, etc...
        public static void ConsoleLoop()
        {
            bool keeprunning = true;

            while (keeprunning)
            {
                // Wait for input
                Console.Write("Group Chat Bot: ");
                string input = Console.ReadLine();

                // Add another Steam instance
                if (input == "addbot")
                {
                    // Get username and password
                    Console.Write("Username: "******"Password: "******"killbot")
                {
                    // Get username to kill...
                    Console.Write("Username: "******"global "))
                {
                    string toSend = input.Substring(7);
                    SendGlobalMessage(toSend);
                }
                else if (input == "quit")
                {
                    keeprunning = false;
                    foreach (SteamBot bot in bots.Values)
                    {
                        bot.KillBot();
                    }
                }
                else if (input.StartsWith("kick "))
                {
                    string  str_target = input.Substring(5);
                    SteamID target     = new SteamID(str_target);
                    friends[target].steamBot.steamFriends.RemoveFriend(target);
                    friends.Remove(target);
                }


                Console.WriteLine();
            }
        }
コード例 #2
0
 public Chatter(SteamID sid, SteamBot sBot, string chan)
 {
     steamID     = sid;
     active      = true;
     channel     = chan;
     steamBot    = sBot;
     addedToList = false;
 }
コード例 #3
0
ファイル: Main.cs プロジェクト: natehak/SteamGroupChatBot
        // Input loop for adding bots, sending global messages, etc...
        public static void ConsoleLoop()
        {
            bool keeprunning = true;
            while (keeprunning)
            {
                // Wait for input
                Console.Write ("Group Chat Bot: ");
                string input = Console.ReadLine ();

                // Add another Steam instance
                if (input == "addbot")
                {
                    // Get username and password
                    Console.Write("Username: "******"Password: "******"killbot")
                {
                    // Get username to kill...
                    Console.Write ("Username: "******"global "))
                {
                    string toSend = input.Substring(7);
                    SendGlobalMessage(toSend);
                } else if (input == "quit") {

                    keeprunning = false;
                    foreach (SteamBot bot in bots.Values)
                    {
                        bot.KillBot();
                    }
                } else if (input.StartsWith ("kick "))
                {
                    string str_target = input.Substring (5);
                    SteamID target = new SteamID(str_target);
                    friends[target].steamBot.steamFriends.RemoveFriend(target);
                    friends.Remove(target);
                }

                Console.WriteLine ();
            }
        }