Simulating a tap and drag

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
dryzzt
Newbie
Posts: 1
Joined: Thu Oct 13, 2016 11:03 am

Simulating a tap and drag

Post by dryzzt » Thu Oct 13, 2016 11:11 am

So I'm playing an Android game on my laptop utilizing Mobizen. I'm trying to simulate when you tap and drag to scroll through the screen. Here's the code I've been trying

Code: Select all

MouseMove>850,550
LDown
MouseMove>850,150
LUp
I've tried different variations, including one that moved the mouse one pixel at a time to simulate the input that it would normally get from a finger sliding across the screen. What happens is that either 1. it doesn't scroll at all, or if it does, it is not consistently in the same direction or 2. it reads it like a tap and opens what you tapped on instead of scrolling through.

Has anyone got something like this to work? And if so, how?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Simulating a tap and drag

Post by Marcus Tettmar » Fri Oct 14, 2016 10:20 am

The app probably needs to "see" the interim movements. A human can't move the mouse without moving it through the interim positions. Your code "jumps" the mouse directly without passing through those interim coordinates. Try this:

Code: Select all

LDown
Let>y=550
Repeat>y
  MouseMove>850,y
  Let>y=y-5
  Wait>0.02
Until>y=150
LUp
Experiment with the delay and the offset. I've deducted 5 at a time from the Y position. A larger value would move it faster, a small value would be slower but hit more points ... you get the idea.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts