Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
Account Creator [Help/C#]
Results 1 to 4 of 4

Thread: Account Creator [Help/C#]

  1. #1

    Account Creator [Help/C#]

    Hey guys im trying to automate my account creation for reasons heh.
    So heres what the site actually "POST" to create the account.



    and heres my code...
    PHP Code:
    public static string CreateAccount()
        {
           
    //get token
            
    string html;
            
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("https://secure.tibia.com/account/?subtopic=createaccount");
            
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            
    StreamReader reader = new StreamReader(response.GetResponseStream());            
            
    html reader.ReadToEnd();
            
    response.Close();
            
    HtmlAgilityPack.HtmlDocument htmldoc = new HtmlAgilityPack.HtmlDocument();
            
    htmldoc.LoadHtml(html);
            
    HtmlAgilityPack.HtmlDocument doc htmldoc;
            
    HtmlNodeCollection PHeaderNodes GetNodes("//input"doc);
                
    //   Console.WriteLine("Node:" + 66 + " | " + PHeaderNodes[66].Attributes[2].Value);          
           //create account
            
    HttpWebRequest request1 = (HttpWebRequest)HttpWebRequest.Create("https://secure.tibia.com/account/?subtopic=createaccount");
            
    request1.Method "POST";      
            
    request1.KeepAlive true;
            
    request1.ContentType "application/x-www-form-urlencoded";        
            
    request1.Accept "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
            
    string account "sa4f89sa4fsa84fsa84f"//random string
            
    string email account+"@"+account+".com"//works
            
    string postData "&accountname=" account +
                              
    "&email=" email +
                              
    "&password1=" account +
                              
    "&password2=" account +
                              
    "&name=" Account.Character.GetName()+ //gets a random name
                              
    "&sex=male"+
                              
    "&server_location=" "on"+
                              
    "&server_pvp_type=" "on"+
                              
    "&world=" "Server_Eldera"+
                              
    "&agreeagreements=" "true"+
                              
    "&token=" PHeaderNodes[66].Attributes[2].Value //gets the token from the page                      
                              
    "&step" "docreate"+
                              
    "&noframe=" +
                              
    "&Submit.x" "131" +
                              
    "&Submit.y" "25";

            
    byte[] byteArray Encoding.UTF8.GetBytes(postData);
            
    request1.ContentLength byteArray.Length;
            
    Stream dataStream request1.GetRequestStream();
            
    dataStream.Write(byteArray0byteArray.Length);
            
    dataStream.Close();
            
    HttpWebResponse response1 = (HttpWebResponse)request1.GetResponse();    
            
    dataStream response1.GetResponseStream();
            
    StreamReader reader1 = new StreamReader(dataStream);
            
    string responseFromServer reader1.ReadToEnd();
            
    reader1.Close();
            
    dataStream.Close();
            
    response1.Close();
            return 
    responseFromServer;
        }

    for some reason it doesnt work and when i try to look at the response in a browser the only thing that isnt filled is the world. anyone know how to fix this? or maybe a better way to do this?


    -----fixed i was missing some "="

    PHP Code:
    public static string CreateAccount()
        {
           
    //get token
            
    string html;
            
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("https://secure.tibia.com/account/?subtopic=createaccount");
            
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            
    StreamReader reader = new StreamReader(response.GetResponseStream());            
            
    html reader.ReadToEnd();
            
    response.Close();
            
    HtmlAgilityPack.HtmlDocument htmldoc = new HtmlAgilityPack.HtmlDocument();
            
    htmldoc.LoadHtml(html);
            
    HtmlAgilityPack.HtmlDocument doc htmldoc;
            
    HtmlNodeCollection PHeaderNodes GetNodes("//input"doc);
                
    //   Console.WriteLine("Node:" + 66 + " | " + PHeaderNodes[66].Attributes[2].Value);          
           //create account
            
    HttpWebRequest request1 = (HttpWebRequest)HttpWebRequest.Create("https://secure.tibia.com/account/?subtopic=createaccount");
            
    request1.Method "POST";      
            
    request1.KeepAlive true;
            
    request1.ContentType "application/x-www-form-urlencoded";        
            
    request1.Accept "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
            
    string account "sa4f89sa4fsa84fsa84f"//random string
            
    string email account+"@"+account+".com"//works
            
    string postData "&accountname=" account +
                              
    "&email=" email +
                              
    "&password1=" account +
                              
    "&password2=" account +
                              
    "&name=" Account.Character.GetName()+ //gets a random name
                              
    "&sex=male"+
                              
    "&server_location=" "on"+
                              
    "&server_pvp_type=" "on"+
                              
    "&world=" "server_Eldera"+
                              
    "&agreeagreements=" "true"+
                              
    "&token=" PHeaderNodes[66].Attributes[2].Value //gets the token from the page                      
                              
    "&step=" "docreate"+
                              
    "&noframe=" +
                              
    "&Submit.x=" "131" +
                              
    "&Submit.y=" "25";

            
    byte[] byteArray Encoding.UTF8.GetBytes(postData);
            
    request1.ContentLength byteArray.Length;
            
    Stream dataStream request1.GetRequestStream();
            
    dataStream.Write(byteArray0byteArray.Length);
            
    dataStream.Close();
            
    HttpWebResponse response1 = (HttpWebResponse)request1.GetResponse();    
            
    dataStream response1.GetResponseStream();
            
    StreamReader reader1 = new StreamReader(dataStream);
            
    string responseFromServer reader1.ReadToEnd();
            
    reader1.Close();
            
    dataStream.Close();
            
    response1.Close();
            return 
    responseFromServer;
        }

    enjoy
    Last edited by Warlockx; 01-14-2015 at 03:24 PM.

  2. #2
    Junior Member
    Join Date
    Jan 2015
    Posts
    27
    only register with ".com" email?

  3. #3
    Quote Originally Posted by sleepy22 View Post
    only register with ".com" email?
    this was just a test you can use any email... but it has to be "user@domain.com"

  4. #4
    Junior Member
    Join Date
    Feb 2015
    Posts
    1
    hey friend, I have sent PM to you could you check?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •