Yirrlaar Posted January 30, 2018 Share Posted January 30, 2018 local $results, $h, $PID $BlueStacks_Path = @ProgramFilesDir & "\BlueStacks\" $BlueStacks_Path = StringReplace($BlueStacks_Path, "\\", "\") $h = Run($BlueStacks_Path & "hd-Adb connect localhost","","",$STDIO_INHERIT_PARENT) sleep(1000) $PID = run($BlueStacks_Path & "HD-Frontend.exe Android") WinGetProcess($PID) sleep(1000) Do $result = run($BlueStacks_Path & "HD-Adb shell getprop sys.boot_completed", "", "", BitOR($STDIN_CHILD, $STDERR_MERGED)) ConsoleWrite("$result: " & $result & @CRLF) sleep(1000) until $result = 1 Hi ALL, I am really knew at this and I am trying to figure out why I get an infinite loop when I am checking to see if BlueStacks is open. If I do everything command line based, everything WORKS as above, but when I put it in AutoIT it just LOOPS & LOOPS & LOOPS. When I do the consolewrite, it's like it is giving me a PID# rather than return 1. What am I doing wrong? Link to comment Share on other sites More sharing options...
Moonscarlet Posted January 30, 2018 Share Posted January 30, 2018 (edited) Because the return of Run() is the PID of what you launched not 1 (if it succeeds): Quote Return Value Success: the PID of the process that was launched. Edited January 30, 2018 by Moonscarlet Link to comment Share on other sites More sharing options...
Moonscarlet Posted January 30, 2018 Share Posted January 30, 2018 I guess you should see if it's not 0 or not @error for your check. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 30, 2018 Moderators Share Posted January 30, 2018 As Bluestacks markets itself specifically as an "Android Gaming Platform", discussions on automating it run afoul of our forum rules. Please read them now, especially the part on game automation, before you post again. Moonscarlet 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts