Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 22:08

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] [AutoIt] Auto-login source code

Discussion on [Release] [AutoIt] Auto-login source code within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2011
Posts: 82
Received Thanks: 12
[Release] [AutoIt] Auto-login source code

Hello ElitePvPers,

lots of members here have helped me a lot, by giving me source codes, explanations on about everything related to CO. I would like to share one of my AutoIt function that I've developped for my own mining bot.

Unfortunately, it has some restriction :
  • Works for french client (need to be adapted)
  • Works for screen resolution of 1024x768

I'm french and I've deleted CO2 US from my disk, so I don't know if the button IDs change bewteen the different clients.

Hum, the code works very well and may help lots of people who are borred to login their accounts.

About the source code : It's composed of one exemple + the function to login. As I said, you may have to update controls ID or function protocole.

It's a very little release and not very useful for all of you, but for AutoIt coders, it might help.

Thanks again for your help!

PHP Code:
Opt('SendKeyDelay',80) ; MUST BE WRITTEN. If notthe client will bug your pseudo and pass

Global $myChar[4] = ["MyCharacterName","Pseudo","Pass","Medium"], $playTitle "Play"$gameTitle "[Conquête] Retour De Légende"
Global $loginObject "MacromediaFlashPlayerActiveX1"$btnGraphIDs[3] = [1008,1001,1007] ; LowMediumHigh Quality
Global $playDir "C:\Program Files\Conquete 2.0\play.exe"

$myChar[0] = InputBox("Login","Enter the character name of the account")
$myChar[1] = InputBox("Login","Enter the pseudo")
$myChar[2] = InputBox("Login","Enter the password","","*")
$myChar[3] = InputBox("Login","Enter what definition you want the game to be (Low,Medium,HD)")

_Login($myChar)

Func _Login($array)
    If 
IsArray($arrayThen
        Run
($playDir) ; lunches the game
        WinWait
($playTitle) ; waits for the first GUI (where you choice the graphismsto appear
            
For $i 1 To 10 loop to be sure to lunch the graphisms
                
Switch $array[3] ; selon le type de graphisme
                    
Case "Low"
                        
ControlClick($playTitle,"",$btnGraphIDs[0])
                    Case 
"Medium"
                        
ControlClick($playTitle,"",$btnGraphIDs[1])
                    Case 
"HD"
                        
ControlClick($playTitle,"",$btnGraphIDs[2])
                    Case 
"default"
                        
ControlClick($playTitle,"",$btnGraphIDs[1])
                EndSwitch
            
Next
        WinWait
($gameTitle) ; wait for the login GUI to appear
        WinSetTitle
($gameTitle,"",$array[0]) ; sets the name of the GUI as the CharacterName
        WinActivate
($array[0]) ; focuses on the GUI

        
While we take 4 pixels on the screen which will tell if the GUI is ready to be used
            
If Hex(PixelGetColor(30,26)) = "00666666" Then
                
If Hex(PixelGetColor(955,22)) = "00A27542" Then
                    
If Hex(PixelGetColor(969,721)) = "00112728" Then
                        
If Hex(PixelGetColor(33,722)) = "006B1300" Then
                            ExitLoop 
; if pixels are detectedwe're ready to go
                        EndIf
                    EndIf
                EndIf
            EndIf
            Sleep(10)
        WEnd
        Sleep(150)

        ControlClick($array[0],'',$loginObject,"left",2,496,656) ; 2 clicks on the pseudo bar
        Sleep(60)
        ControlSend($array[0],'',$loginObject,"{BS}") ; erases previous pseudo

        Sleep(150)
        ControlSend($array[0],'',$loginObject,$array[1]) ; writes pseudo

        Sleep(150)

        ControlClick($array[0],'',$loginObject,"left",1,496,686) ; clicks on the pass barr
        ControlSend($array[0],'',$loginObject,$array[2]) ; writes the password

        Sleep(60)

        ControlClick($array[0],'',$loginObject,"left",3,716,721) ; clicks three times in the enter button

        Sleep(2000) ; waits 2 second before exiting
    EndIf
EndFunc 
EDIT : Tip : With a loop and an ini file, making a full auto-login is a piece of cake.
itachi26 is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
[RELEASE] [OPEN SOURCE] CE 5.5 Pointer to AutoIt Source-Code
02/13/2011 - AutoIt - 6 Replies
Habe heute erst gemerkt, dass es hier eine AutoIt Sektion gibt xD also poste ich mal mein Programm mit rein. Funktionsweise: 1. in CE Rechtsklick auf den Pointer und auf "Copy" klicken 2. in meinem Programm auf "Code generieren" klicken 3. In euer Scite gehen und einfügen Hier ist der Source Code vom Programm:



All times are GMT +1. The time now is 22:08.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.