Bluestacks 3 cursor x y coordinates9/22/2023 ![]() ![]() = New Point(CInt(TextBox18.Text), CInt(TextBox17.Text)) = New Point(CInt(TextBox22.Text), CInt(TextBox21.Text)) = New Point(CInt(TextBox26.Text), CInt(TextBox25.Text)) = New Point(CInt(TextBox28.Text), CInt(TextBox27.Text)) = New Point(CInt(TextBox24.Text), CInt(TextBox23.Text)) = New Point(CInt(TextBox20.Text), CInt(TextBox19.Text)) ![]() Psi.Arguments = "/im " & processName & " /f" Public Sub KillHungProcess(processName As String)ĭim psi As ProcessStartInfo = New ProcessStartInfo Mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 1) Shell("cmd.exe /k " + """C:\Program Files\BlueStacks_nxt\HD-Player.exe"" -instance Nougat32 -cmd launchApp -package ") Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick Timer4.Interval = CInt(TextBox31.Text) * 1000 * 60 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If RadioButton1.Checked And GetAsyncKeyState(Keys.F3) Then If RadioButton2.Checked And GetAsyncKeyState(Keys.F2) Then If RadioButton2.Checked And GetAsyncKeyState(Keys.F1) Then If RadioButton1.Checked And GetAsyncKeyState(Keys.F2) Then If RadioButton1.Checked And GetAsyncKeyState(Keys.F1) Then ![]() Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick If RadioButton2.Checked And Button1.Enabled And clickrate >= 0.1 Then ![]() If RadioButton1.Checked And Button1.Enabled And clickrate >= 0.1 Then If Double.TryParse(TextBox1.Text, clickrate) Then Mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0) Mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0) Mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) Mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dwextrainfo As Long) Private Const MOUSEEVENTF_RIGHTDOWN = &H8 Print(f"Max Val: ", max_loc, cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 255), 2)Ĭv2.Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Win32gui.PostMessage(hwnd, win32con.WM_LBUTTONUP, 0, l_param) Win32gui.PostMessage(hwnd, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, l_param) L_param = win32api.MAKELONG(mouse_x, mouse_y) Mouse_y = math.floor(max_loc + height / 2) Mouse_x = math.floor(max_loc + width / 2) Min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result_image) Result_image = cv2.matchTemplate(scr, template, cv2.TM_CCOEFF_NORMED) I know I can make this easily with pyautogui, but I don't want to make the program move the actual cursor, and one of the key features is that it can be run without needing to have the window on the foreground (not focusing the window). Everything works, except the clicking part, I've done a lot of research and tried different things, but I can't get it to work. I'm trying to automate a process in BlueStacks where I wait for an element to appear on the screen, and when it appears, click it. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |