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 not, the 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] ; Low, Medium, High 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($array) Then
Run($playDir) ; lunches the game
WinWait($playTitle) ; waits for the first GUI (where you choice the graphisms) to 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 1 ; 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 detected, we'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






