Exemplo n.º 1
0
 /// <summary>
 /// Send message to chat.
 /// </summary>
 /// <param name="text">Text to send.</param>
 public void Chat(string text)
 {
     if (ChatPrefix != null)
     {
         text = ChatPrefix + " " + text;
     }
     //if (!cg.OpenChatIsDefault)
     OpenChat();
     cg.updateScreen();
     // To prevent abuse, make sure that the channel is not general.
     if (!cg.CompareColor(ChatLocation.X, ChatLocation.Y, GeneralChatColor, 20) || !BlockGeneralChat)
     {
         cg.TextInput(text);
     }
     cg.KeyPress(Keys.Return);
     if (cg.OpenChatIsDefault)
     {
         Thread.Sleep(250);
         OpenChat();
     }
     cg.ResetMouse();
 }
 /// <summary>
 /// Changes the custom game's name.
 /// </summary>
 /// <param name="name">Name to change game name to.</param>
 // Changes the game's name
 public void SetGameName(string name)
 {
     if (name.Length < 3)
     {
         throw new ArgumentOutOfRangeException("name", name, "The length of name is too low, needs to be at least 3.");
     }
     if (name.Length > 64)
     {
         throw new ArgumentOutOfRangeException("name", name, "The length of name is too high, needs to be 64 or lower.");
     }
     cg.LeftClick(209, 165); // click on game's name
     cg.TextInput(name);
     cg.KeyPress(Keys.Return);
     Thread.Sleep(500);
 }