astranberg Posted April 5, 2016 Share Posted April 5, 2016 Hello Everybody! I'm new here (as you can see; first post) and also new to AutoIt. I have done lots of search and browsing of the forum to learn what I'm doing wrong, but I just can't figure it out. Hopefully one of you can help me. I finally figured out how to launch and get the handle of the program I'm automating (Bluestacks, and android emulator). Now I would like to search within that window to find a button, then click that button. To do that I'm trying to use ImageSearch from here: #include <ScreenCapture.au3> #include <ImageSearch.au3> $AndroidPID = Run ("C:\ProgramData\BlueStacksGameManager\BlueStacks.exe") Sleep(250) $AndroidHWND = WinGetHandle("[ACTIVE]") $AndroidPos = WinGetPos($AndroidHWND) ;--> [0] = X pos, [1] = Y pos; [2] = Width; [3] = Height $x = 0 $y = 0 $found = _ImageSearchArea("FindMe.bmp", 1, $AndroidPos[0], $AndroidPos[1], $AndroidPos[2], $AndroidPos[3], $x, $y, 100) If $found = 1 Then MouseMove($x,$y, 10) EndIf MsgBox (0, '', $found) ;--> Returns 0 MsgBox(0, '', $AndroidPos[0] & @CRLF & $AndroidPos[1] &@CRLF & $AndroidPos[2] &@CRLF & $AndroidPos[3]) ;--> Returns 0, 0, 1602, 950 Thanks! Adam Link to comment Share on other sites More sharing options...
alien4u Posted April 5, 2016 Share Posted April 5, 2016 Hi @astranberg and welcome to AutoIt Forum. I do like Android and I work with android alot, please explain what or why you need this because maybe I could help you to do it with another approach. In a different way i mean. I cant help you with BlueStack because I finish with them long time ago. Kind Regards Alien. Link to comment Share on other sites More sharing options...
astranberg Posted April 5, 2016 Author Share Posted April 5, 2016 Thanks @alien4u! Awesome! The ultimate project is to automate a game called Clash Royale. I am not going to do anything crazy like they have for Clash of Clans bots (I'm assuming you're familiar). Here is the grand scheme: Launch Clash Royale Click a couple buttons to launch a game against the 'trainer'. Playing the game will consist of recognizing resource level ("Elixir" can be anywhere between 0-10), clicking on cards to select them, and clicking on the battlefield. Right now I'm just trying to click the button to launch Clash Royale. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 5, 2016 Developers Share Posted April 5, 2016 Please read our forum rules, specifically the part about game automation! SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts