01-17-2015, 02:00 AM
Hello guys,
First of all sorry for my english level because i'm French so i'm gonna try to do my best.
I Downloaded this bot last week and start thinking about giving my contribution. I'll be happy if I can contribute to the development of this bot.
Here's already the little piece of work I started working on (donation function) :
Func DonateCC()
While 1
SetLog("Donating for Clan Castle's Troops")
Click(10, 334)
If _Sleep(5000) Then ExitLoop
Click(189, 24)
SetLog("Wa 5 sec")
$DonateTroop = _PixelSearch(122, 122, 122, 650, Hex(0xCEEB7C, 6), 10)
While IsArray($DonateTroop)
SetLog("Trouvé bouton donation en " & $DonateTroop[0] & "," & $DonateTroop[1])
Click($DonateTroop[0], $DonateTroop[1]) ; click button donate
If _Sleep(2000) Then ExitLoop
Click(($DonateTroop[0]+200), ($DonateTroop[1]-20),5) ; donate archer
If _Sleep(5000) Then ExitLoop
$DonateTroop = _PixelSearch(122, 122, 122, ($DonateTroop[1]-20), Hex(0xCEEB7C, 6), 10)
WEnd
If _Sleep(1000) Then ExitLoop
Click(330, 334)
ExitLoop
WEnd
For the moment, this function only allows to give archers to members of your clan who made a request
TO-DO list : Link fonction with GUI parameters and add switch case to recognize which troops I configured the bot to donate (e.g : barbs, archers, giants; etc...)
I also found some solution to resolve screenshot problems when running the bot with background mode disable (v5.4.2.2) and a fix for memory leaks that happens when training troops (original script don't correctly delete $hHBitmap variable) . I can post solution if authours of the script allows me too.
Thanks for all and again, sorry for my english
First of all sorry for my english level because i'm French so i'm gonna try to do my best.
I Downloaded this bot last week and start thinking about giving my contribution. I'll be happy if I can contribute to the development of this bot.
Here's already the little piece of work I started working on (donation function) :
Func DonateCC()
While 1
SetLog("Donating for Clan Castle's Troops")
Click(10, 334)
If _Sleep(5000) Then ExitLoop
Click(189, 24)
SetLog("Wa 5 sec")
$DonateTroop = _PixelSearch(122, 122, 122, 650, Hex(0xCEEB7C, 6), 10)
While IsArray($DonateTroop)
SetLog("Trouvé bouton donation en " & $DonateTroop[0] & "," & $DonateTroop[1])
Click($DonateTroop[0], $DonateTroop[1]) ; click button donate
If _Sleep(2000) Then ExitLoop
Click(($DonateTroop[0]+200), ($DonateTroop[1]-20),5) ; donate archer
If _Sleep(5000) Then ExitLoop
$DonateTroop = _PixelSearch(122, 122, 122, ($DonateTroop[1]-20), Hex(0xCEEB7C, 6), 10)
WEnd
If _Sleep(1000) Then ExitLoop
Click(330, 334)
ExitLoop
WEnd
For the moment, this function only allows to give archers to members of your clan who made a request
TO-DO list : Link fonction with GUI parameters and add switch case to recognize which troops I configured the bot to donate (e.g : barbs, archers, giants; etc...)
I also found some solution to resolve screenshot problems when running the bot with background mode disable (v5.4.2.2) and a fix for memory leaks that happens when training troops (original script don't correctly delete $hHBitmap variable) . I can post solution if authours of the script allows me too.
Thanks for all and again, sorry for my english