Thread Rating:
  • 7 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Developing Bot
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.


Code:
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.
(12-27-2014, 12:50 AM)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.



Code:
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?
(12-27-2014, 12:58 AM)kojometa Wrote:  
(12-27-2014, 12:50 AM)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.






Code:
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)?
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!
(12-27-2014, 01:20 AM)kojometa Wrote:  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.
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!
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.
(12-27-2014, 01:46 AM)kojometa Wrote:  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
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
(12-27-2014, 03:55 AM)kojometa Wrote:  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
 


Forum Jump:


Users browsing this thread: 60 Guest(s)

About The Bytecode Club

We're a community focused on Reverse Engineering, we try to target Java/Android but we also include other langauges/platforms. We pride ourselves in supporting and free and open sourced applications.

Website