Getting Script To Recognize The BlueStacks Restore Backup Button

Ask gaming related questions (AHK v1.1 and older)
QHZ
Posts: 3
Joined: 16 Mar 2018, 13:49

Getting Script To Recognize The BlueStacks Restore Backup Button

20 Mar 2018, 03:59

I am new to AutoHotKey, so I am still learning the script. I've been trying to get this small section of my overall larger script to recognize the restore backups button, see here:
Spoiler
I've been using PixelSearch, but for some reason it does not recognize the color. I have tried searching for the reds and whites shown in the button. At one point it was working, but once I added the loop to return to the menu to try to load the button if PixelSearch failed, PixelSearch never succeeds unless the color variation is extremely high. I think it has everything to how I coded the script and the order things run it. I want to run more things under the script section posted below this paragraph, so I mainly use Goto to skip the code tied to a timer which lies between the code which came before and the code I want to run after (trying to keep older code at top, and newer at bottom).

Right now the code is modeled to search for white, but the red is preferred. I have to update the coordinates around the button to actually search for white, but I tested it with updated coordinates and the result was the same as always (cursor moves between button and the right sided menu). Whenever I use GetPixelColor, the HEX code is always black, gray or blue, usisng fast or slow, with or without alt.

If there's a way to detect the button without color detection, I would love to hear it.

Code: Select all

#Warn  
#SingleInstance

CoordMode, Mouse, Screen

^R::
MouseMove, 1441, 23, 4 ; move to arrow
Sleep, 500
Click
Sleep, 500
MouseMove, 1493, 52, 4 ; move to settings
Sleep, 500
Click
Sleep, 1200
MouseMove, 436, 615, 4 ; move to backup and restore
Sleep, 500
Click
Sleep, 500
MouseMove, 1187, 718, 4 ; move to restore backup position
SetTimer, checkBackupColor, 100
checkBackupColor:
MouseGetPos, restoreX, restoreY
radFindColor := 3
topLeft_X := restoreX - radFindColor
topLeft_Y := restoreY - radFindColor
bottomRight_X := restoreX + radFindcolor
bottomRight_Y := restoreY + radFindColor
PixelSearch, RestorePx, RestorePy, topLeft_X, topLeft_Y, bottomRight_X, bottomRight_Y, 0xFFFFFF, 10, Alt, Slow
if ErrorLevel
{
SetTimer, checkBackupColor, off
Sleep, 500
MouseMove, 436, 615, 4 ; move to backup and restore
Sleep, 500
Click
Sleep, 500
MouseMove, 1187, 718, 4 ; move to restore backup position
Sleep, 500
Goto, checkBackupColor
}
else 
{
SetTimer, checkBackupColor, off
Sleep, 3000
ToolTip, color found, %restoreX%, %restoreY%
}
Sleep, 500
Click
Sleep, 500
MouseMove, 769, 637, 4 ; move to restore 
Sleep, 500
Click
Sleep, 6000
MouseMove, 856, 462, 4 ; move to OneDrive
Sleep, 500
Click
Sleep, 500
MouseMove, 913, 481, 4 ;  move to Bluestacks_#
Sleep, 500
Click
Sleep, 500
MouseMove, 984, 922, 4 ; move to OK button
Sleep, 500
Click
Sleep, 60000

Esc::ExitApp  ; Exit script with Escape key




Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: vysmaty and 118 guests