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
(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.
(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?
(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?Currently my boost is paused due to last maintenance. Maybe I will clear the boost and see how later.
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: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!
(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