The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

Developing Bot

Started by Antidote · Dec 5, 2014

1,033 replies21,297,466 viewsLocked
Dec 26, 2014#461

I am also having the same problem of unable to train troop. I have located the barrack, but it seems like it is unable to click Train Troops.  I have tried the mouse pointer out of the Bluestacks. Still didnt work.

Is there anything to do with my pausing of Boost after maintenance for barrack?

I have confirmed that my bluestack resolution is set to 860,720 using the reg file provided.
I am using Bluestack latest version 0.9.6.4092.

Func TrainBarrack($x, $y, $z)
   GUICtrlSetData($Results, "Func TrainBarrack" & @CRLF, -1)
   While 1
  If $RunState = False Then
 ExitLoop
  EndIf
  ControlClick ($HWnD, "","", "left", "1", 100*$x_ratio, 100*$y_ratio) ; Making sure no Barrack active
  sleep(1000)
  ControlClick ($HWnD, "","", "left", "1", $x, $y)
  Sleep(3000) ;Long sleep for slow Machines
  ControlClick ($HWnD, "","", "left", "1", 600, 620)
  Sleep(3000) ;Long sleep for slow Machines
  $Pixel = _ColorCheckVariation(Hex(PixelGetColor(377, 546, $HWnD),6), Hex(0xD03838,6),20)
  If $Pixel = True Then
 $FullArmy = True
  EndIf

600,620 is Train Troops?

How to know my Bluestack Mouse Coordination (x,y)? I couldn't find developer options.

Please help. Thank you.

Dec 26, 2014#462

I am also having the same problem of unable to train troop. I have located the barrack, but it seems like it is unable to click Train Troops.  I have tried the mouse pointer out of the Bluestacks. Still didnt work.

Is there anything to do with my pausing of Boost after maintenance for barrack?

I have confirmed that my bluestack resolution is set to 860,720 using the reg file provided.
I am using Bluestack latest version 0.9.6.4092.

Func TrainBarrack($x, $y, $z)
   GUICtrlSetData($Results, "Func TrainBarrack" & @CRLF, -1)
   While 1
  If $RunState = False Then
 ExitLoop
  EndIf
  ControlClick ($HWnD, "","", "left", "1", 100*$x_ratio, 100*$y_ratio) ; Making sure no Barrack active
  sleep(1000)
  ControlClick ($HWnD, "","", "left", "1", $x, $y)
  Sleep(3000) ;Long sleep for slow Machines
  ControlClick ($HWnD, "","", "left", "1", 600, 620)
  Sleep(3000) ;Long sleep for slow Machines
  $Pixel = _ColorCheckVariation(Hex(PixelGetColor(377, 546, $HWnD),6), Hex(0xD03838,6),20)
  If $Pixel = True Then
 $FullArmy = True
  EndIf

600,620 is Train Troops?

How to know my Bluestack Mouse Coordination (x,y)? I couldn't find developer options.

Please help. Thank you.

for low level barracks it doesnt work because there are only 3 buttons when you click on barrack.
high level barracks have 5 buttons.
can it be that there are only 3 buttons for you?

Dec 26, 2014#463

kojometa wrote:

dinobot wrote:

I am also having the same problem of unable to train troop. I have located the barrack, but it seems like it is unable to click Train Troops.  I have tried the mouse pointer out of the Bluestacks. Still didnt work.

Is there anything to do with my pausing of Boost after maintenance for barrack?

I have confirmed that my bluestack resolution is set to 860,720 using the reg file provided.
I am using Bluestack latest version 0.9.6.4092.

Func TrainBarrack($x, $y, $z)
   GUICtrlSetData($Results, "Func TrainBarrack" & @CRLF, -1)
   While 1
  If $RunState = False Then
 ExitLoop
  EndIf
  ControlClick ($HWnD, "","", "left", "1", 100*$x_ratio, 100*$y_ratio) ; Making sure no Barrack active
  sleep(1000)
  ControlClick ($HWnD, "","", "left", "1", $x, $y)
  Sleep(3000) ;Long sleep for slow Machines
  ControlClick ($HWnD, "","", "left", "1", 600, 620)
  Sleep(3000) ;Long sleep for slow Machines
  $Pixel = _ColorCheckVariation(Hex(PixelGetColor(377, 546, $HWnD),6), Hex(0xD03838,6),20)
  If $Pixel = True Then
 $FullArmy = True
  EndIf

600,620 is Train Troops?

How to know my Bluestack Mouse Coordination (x,y)? I couldn't find developer options.

Please help. Thank you.

for low level barracks it doesnt work because there are only 3 buttons when you click on barrack.
high level barracks have 5 buttons.
can it be that there are only 3 buttons for you?

I am running on max lvl barrack lvl 10, with 3 button, Info, Boost/Resume, Train Troops.

If the script is written for 5 button, how to re-set the coordinate? How to determine my pixel coordinate (x,y)?

Dec 26, 2014#464

i dont know why its not showing 5 buttons to you. the 2 missing buttons are "boosts" is that right?
i think we'll have to change the coordinates my pixel- or imagesearch.
do you know why it doesnt suggest you to boost your barracks? dont you have gems or what are the reasons for that?

im gonna be looking for a solution!

Dec 26, 2014#465

i dont know why its not showing 5 buttons to you. the 2 missing buttons are "boosts" is that right?
i think we'll have to change the coordinates my pixel- or imagesearch.
do you know why it doesnt suggest you to boost your barracks? dont you have gems or what are the reasons for that?
im gonna be looking for a solution!

Currently my boost is paused due to last maintenance. Maybe I will clear the boost and see how later.
Anyway, I managed to get my 3 button, x,y coordinate and I changed it to 523,623 for now and the training is working.

Dec 26, 2014#466

Okay i worked something out.
Test this and tell me if it works for you!

http://pastebin.com/GQxx4bsG

This is looking for a specific pixelcolor of the sword of the "traintroop" button in the bottom area of bluestacks.
if it finds that color, its gonna click on it.
tell me if it worked because this is the way the bot will detect buttons in the future anyway probably!

Dec 26, 2014#467

hello im new here. is editing the building colors helps determine enemy based and estimate their power??
and i think its easy to recognize pixel color .. since you guys using it to know what to click.. for example i will make all building black and white and max walls or max towers to some colors where our bot can recognize it.

Dec 26, 2014#468

Okay i worked something out.
Test this and tell me if it works for you!

http://pastebin.com/GQxx4bsG

This is looking for a specific pixelcolor of the sword of the "traintroop" button in the bottom area of bluestacks.
if it finds that color, its gonna click on it.
tell me if it worked because this is the way the bot will detect buttons in the future anyway probably!

The colour hex code u given me don't work but after i changed to mine 0x683C18, it work. Still learning...

$TrainTroop = PixelSearch(0,500,900,700,0x683C18,0,1,$HWnD

May i ask what does 0,500,900,700 mean? want to know the area it searching.

Thanks

Dec 26, 2014#469

its the searching-area in the bluesracks window.
i enhanced it. take $TrainTroop = PixelSearch(190,550,670,650,0x9F7328,0,1,$HWnD)
change the color if my color still doesnt work for you

Dec 26, 2014#470

its the searching-area in the bluesracks window.
i enhanced it. take $TrainTroop = PixelSearch(190,550,670,650,0x9F7328,0,1,$HWnD)
change the color if my color still doesnt work for you

works perfectly, thanks. just want to be more specify, what does 190 mean, 550? 670? 650?

Also like to thanks AtoZ for the nice all round attack... #447

This discussion is closed.