Hello,

Im trying to make an automation to create new character on existing account, but unfortunately I'm stuck in.. umm... first step I guess...
The whole point is that it reaches https://secure.tibia.com/account/?su...ountmanagement, stores every single cookie etc. but here's the end. Syntax of POST request is correct.
Code:
loginname={0}&loginpassword={1}&page=overview&Login.x=0&Login.y=0
was taken from Web Debbuger. x & y variables mean the position of a mouse. By default i set 0&0 to use the centre of "Login" button.


Code:
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;


namespace ConsoleApplication1
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            bool flag=false;
            string username = "123456";
            string password = "123456";
            string char_name = "xxxxx";
            var coo = new System.Net.CookieContainer(); 
            do
            {
                try
                {
                    var request = System.Net.WebRequest.Create("https://secure.tibia.com/account/?subtopic=accountmanagement") as System.Net.HttpWebRequest;
                    request.CookieContainer = coo;
                    request.Method = "POST";
                    request.Proxy = new WebProxy("127.0.0.1", 8888); // fiddler 
                    request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                    request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0";
                    using (var stream = request.GetRequestStream()) 
                    {
                        byte[] buffer =
                            Encoding.UTF8.GetBytes(
                                string.Format(
                                    "loginname={0}&loginpassword={1}&page=overview&Login.x=0&Login.y=0",username,password));
                        stream.Write(buffer, 0, buffer.Length); 
                    }
                    using (var response = request.GetResponse() as HttpWebResponse)
                    {
                        coo.Add(response.Cookies);
                        using (var sr = new System.IO.StreamReader(response.GetResponseStream()))
                        {
                            string http_code = sr.ReadToEnd();
                            flag = (http_code.Contains(char_name));
                        }
                    }
                }
                catch (WebException e)
                {
                    Console.Write(e.ToString());
                }
            } while (flag == false) ;
            }
    }
}
I will be grateful for any advice.

Best regards,
Johny.