The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

How to donate other troops?

Started by rozerga Β· Feb 23, 2015

4 replies64,905 views
Feb 23, 2015#1

Hi. Newbie here πŸ™‚ ,
I just want to modify barb to balloons and giant to dragons in donating, but i don't know what DonatePixel(DonateCC.au3) for loons and drags. I try to put 396 for gobs and it works, but when i put 657 for loons, the log says "No troops available for donation, donating later..." Please Help πŸ™‚

If _ColorCheck(_GetPixelColor(657, $DonatePixel[1] - 5), Hex(0x507C00, 6), 10) Or _ColorCheck(_GetPixelColor(657, $DonatePixel[1] - 10), Hex(0x507C00, 6), 10) Then
SetLog("Donating Balloons", $COLOR_BLUE)
If _Sleep(500) Then Return
Click(657, $DonatePixel[1] - 5, 5, 50)
$Donate = True
$CurBarb += 5
ElseIf $ichkDonateAllArchers = 1 Then

Sorry for poor English πŸ™‚
Thanks for responds

Feb 24, 2015#2
Func DonateBarbs()
If $ichkDonateBarbarians = 1 Or $ichkDonateAllBarbarians = 1 Then
Click($DonatePixel[0], $DonatePixel[1] + 11)
If _Sleep(1000) Then Return
_CaptureRegion(0, 0, 725, $DonatePixel[1] + 50)
If _ColorCheck(_GetPixelColor(720, $DonatePixel[1] - 5), Hex(0x507C00, 6), 10) Or _ColorCheck(_GetPixelColor(720, $DonatePixel[1] - 10), Hex(0x507C00, 6), 10) Then
SetLog("Donating Wizards", $COLOR_BLUE)
If _Sleep(500) Then Return
Click(720, $DonatePixel[1] - 5, 5, 50)

_CaptureRegion .... 725 .... then after Getpixel is 720

In our case :

Func DonateBarbs()
If $ichkDonateBarbarians = 1 Or $ichkDonateAllBarbarians = 1 Then
Click($DonatePixel[0], $DonatePixel[1] + 11)
If _Sleep(1000) Then Return
_CaptureRegion(0, 0, 660, $DonatePixel[1] + 50)
If _ColorCheck(_GetPixelColor(657, $DonatePixel[1] - 5), Hex(0x507C00, 6), 10) Or _ColorCheck(_GetPixelColor(657, $DonatePixel[1] - 10), Hex(0x507C00, 6), 10) Then
SetLog("Donating Balons", $COLOR_BLUE)
If _Sleep(500) Then Return
Click(657, $DonatePixel[1] - 5, 5, 50)
Feb 24, 2015#3

Thanks sir promac πŸ™‚ it works with CaptureRegion 660 and GetPixelColor 657 for loons. πŸ™‚
but how about for drag and how you figure out the CaptureRegion needs to be 660? πŸ™‚

Feb 24, 2015#4

After the new update it seems the bot dont donate giants. the log says "No troops available for donation, donating later..." What do i need to edit for giants?

Feb 24, 2015#5

@rozerga
The CaptureRegion always determinate de limits and must be higher then pixel color search ( imagine if the bot donΒ΄t had this limit .... all screen search ) , and then the search pixel color is always "in this limits" ... initial error was that u change the position but fogot the region .... πŸ˜‰
I noob , but I think that is the answer to your question.

Got something to add?

Log in to post a reply.

Join the conversation