Jump to content

MouseClickDrag


Recommended Posts

Hello,

I'm currently working on a bot to automatize some action in a game.

This game use a camera view which can be changed using mouse movement while holding right mousse button on.

I'm actually facing an issue, it seems that in that case MouseClickDrag does not have same behavior everytime.

The following script is a basic example of what i'm doing.

Once the game is launched, I set a Z-axis point of view by looking up (first block), then down (second block).

I was expecting to have the same angle everytime i run that, and it is not to the case.

$offset = 400

MouseMove(@DesktopWidth/2,@DesktopHeight/2-$offset)

MouseClickDrag("right",@DesktopWidth/2,@DesktopHeight/2-$offset,@DesktopWidth/2,@DesktopHeight/2-$offset-1,0)

Sleep(2000)

$offset = 200

MouseMove(@DesktopWidth/2,@DesktopHeight/2+$offset)

MouseClickDrag("right",@DesktopWidth/2,@DesktopHeight/2+$offset,@DesktopWidth/2,@DesktopHeight/2+$offset+1,0)

Sleep(2000)

Here i do a mousedrag of 1 pixel because i supposed that the internal behavior of MouseClickDrag was not always same for longer path.

With longer path, problem is here.

I've done a similar script on another scripting program, which works fine. To my mind it is not an OS or mouse setting issue. I'm running on Seven.

If anyone have an idea of what is happening, if i missed some parameters or if there is another way to do a determinist mouse drag.

Thanks for reading me.

Link to comment
Share on other sites

I dont like to harp on, but it could be that the game has bot countermeasures, so its possible you might be flogging a dead horse.

Google your game title and anti bot, to same yourself some time.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I'm not sure this game has bot countermeasure as using another scripting tool (don't know if i can name it on the forum)

I'm currently testing this piece of code and it seems to work (on 10 try always same angle). May look ugly but if it works it's fine.

$offset = 400

MouseMove(@DesktopWidth/2,@DesktopHeight/2-$offset)

MouseDown("right")

waitLatency()

MouseMove(@DesktopWidth/2,@DesktopHeight/2-$offset-1,0)

MouseUp("right")

Sleep(1000)

Well that issue is giving me serious headache :mellow:, I'm gonna check tomorrow more deeply and confirm if it's work. Maybe a tip for people having similar issue if confirmed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...