Jump to content
jplumb

I have to ControlClick 100-200x to click into BlueStacks

Recommended Posts

jplumb

Like the topic says, when using ControlClick to click into BlueStacks3,

if I just do:

ControlClick("BlueStacks","","","left",1,$pos[0],$pos[1])

It doesn't do anything, no matter how many times I loop it. But if I do a super high number, like:

ControlClick("BlueStacks","","","left",401,$pos[0],$pos[1])

Then it usually works, but still requires more than one attempt on occasion, and even less common it sometimes will click multiple times.

Does anyone know why this happens? I'm wondering if it's because BlueStacks emulates a phone (or tablet), and touch screen software for mobile devices possibly doesn't register tiny nicks on the screen, so that your phone doesn't wake up whenever the smallest particle touches the screen? Or maybe I have no idea what's really going on behind the scenes haha.

Thanks.

Share this post


Link to post
Share on other sites
careca

I guess that is one possibility, another would be that the coordinates are wrong.

How are you setting $pos?


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
jplumb

I got the coords from AutoIt v3 Window Info, under the Control tab, ControlClick Coords. I know the coords are correct because it clicks in the correct place -- it just requires a ton of clicks.

Is there a way to maybe send a MouseDown event through ControlClick (or something similar), then maybe a quarter second later send a MouseUp event?

Share this post


Link to post
Share on other sites
BigDaddyO

Just throwing something out there, have you tried MouseClick("left", $pos[0], $pos[1], 1, 20) to see if that works?

Not sure about this Emulator, but on others I've used, that single control is the entire screen and sending ControlClicks to it acts weird but the normal MouseClick seems to be more reliable in that case.


hmm... I guess I have to have a signature...

Share this post


Link to post
Share on other sites
jplumb

Amazing! Your MouseClickFast() works like a charm!

ControlFocus() did nothing, just FYI.

Share this post


Link to post
Share on other sites
jplumb

Is there a way to just send a MouseDown and MouseUp event using DllCalls directly to BlueStacks, that you know of, so that I can retain control of my mouse? I could probably research more about DllCall's functionality.

Share this post


Link to post
Share on other sites
Zedna
8 hours ago, jplumb said:

Is there a way to just send a MouseDown and MouseUp event using DllCalls directly to BlueStacks, that you know of, so that I can retain control of my mouse? I could probably research more about DllCall's functionality.

Yes, according to AutoIt's 3.1.0 sources where you can see what API uses AutoIt inside ControlClick(), shortly pseudocode:

- AttachThreadInput(target_wnd, true)
- SetActiveWindow(target_wnd)
- PostMessage(target_ctrl, WM_LBUTTONDOWN)
- PostMessage(target_ctrl, WM_LBUTTONUP)
- AttachThreadInput(target_wnd, false)

 

Share this post


Link to post
Share on other sites
jplumb

Thanks! I'll toy with that some more later today.

Share this post


Link to post
Share on other sites
kornboy82

Have you sorted this out? I'm having the same kind of problem. Need to send about 250 clicks for this to work.

Share this post


Link to post
Share on other sites
Bowmore

With ControlClick() the coords specify the position to click relative to the top left of the control,  


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
kornboy82

I know but I have the same behavior as jplumb had. Go read.

Share this post


Link to post
Share on other sites
kornboy82

It's mainly because the clicks do not register so sending 250 ones finally makes them work. It's not the best to do.

Share this post


Link to post
Share on other sites
JLogan3o13

That still doesn't explain why you need to send 250 clicks rapidly, how about a better explanation and help us help you.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
xCROv

bluestacks is an android emulator mainly used for games. Are you wanting to automate something in a game @kornboy82?

Share this post


Link to post
Share on other sites
seandisanti

Kornboy, re-read the original thread, the responses were enough for the OP to solve their issue. 

 

On 2/27/2018 at 5:25 PM, jplumb said:

Amazing! Your MouseClickFast() works like a charm!

ControlFocus() did nothing, just FYI.

Everyone else, it's not that they actually need to send that many, they are trying to send a single click, but because bluestacks is difficult to work with, they're sending hundreds to get it to recognize one.

If at first you don't succeed... try it 200 more times the same exact way, right?

Share this post


Link to post
Share on other sites
JLogan3o13

More importantly, to all - as has been stated numerous times but never seems to sink in - when a Moderator steps into a thread to determine legitimacy, please stay out until it is deemed ok to proceed.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
kornboy82

Well I'm automating a software to deploy on over 8000 computers at my work. Student will be clicking on an AutoIt exe that will click elsewhere with administrative rights but never mind, I found why it was causing my problem. Have a nice day.

Share this post


Link to post
Share on other sites
JLogan3o13

None of which explains what you were trying to do.

Glad you resolved it for yourself.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×