Sign in to follow this  
Followers 0
TomCat

Need some Help with _MouseMovePlus

6 posts in this topic

Hi can someone help me. I try to use _MouseMovePlus to go to some fix points into a game but i dont understand how to define a fix point ;)

Here my testscript but i always get an Error when i start it :P

Hope someone can help me :)

Func _MouseMovePlus($X, $Y,$absolute = 0)

Local $MOUSEEVENTF_MOVE = 1

Local $MOUSEEVENTF_ABSOLUTE = 32768

DllCall("user32.dll", "none", "mouse_event", _

"long", $MOUSEEVENTF_MOVE + ($absolute*$MOUSEEVENTF_ABSOLUTE), _

"long", $X, _

"long", $Y, _

"long", 0, _

"long", 0)

EndFunc

HotKeySet("{PAUSE}", "start")

HotKeySet("{ESC}", "quit")

Func start()

While 1

_MouseMovePlus($X*(65535/@DesktopWidth), $Y*(65535/@DesktopHeight),1)

Sleep(10)

WEnd

EndFunc

Func quit()

Exit 0

EndFunc

While 1

Sleep(10)

WEnd

Share this post


Link to post
Share on other sites



Nobody can help me ? :)

Share this post


Link to post
Share on other sites

ive never used the function but

what are the values of $x and $y?

and what is the error that you get?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I get this Error:

_MouseMovePlus($X*(65535/@DesktopWidth), $Y*(65535/@DesktopHeight),1)

_MouseMovePlus(^ERROR

Error: Variable used without being declared.

When i try _MouseMovePlus(500*(65535/@DesktopWidth), 350*(65535/@DesktopHeight),1)

it works on Windows Desktop but not in the Game.

If i use this _MouseMovePlus(-3,11) it works in game and Windowsdesktop.

The ,1 after 65535/@DesktopHeight) seams to be the reason for not working in game.

I dont understand it -.-

Edited by TomCat

Share this post


Link to post
Share on other sites

Part of your problem is that $X and $Y are not declared in Start(). They are not passed in, and from what you posted, don't appear to be declared globally. Thus, an operation is attempted on a variable that is undeclared.

As for the other coordinate issues, without knowing what the game is, I would venture to guess that the problem with the coordinates is a client coordinate verses screen coordinate issue.

Post you whole script if you can.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I have only this testscript at the moment. Because if it dont work i can not continue with writing the whole Script :)

Func _MouseMovePlus($X, $Y,$absolute = 0)

Local $MOUSEEVENTF_MOVE = 1

Local $MOUSEEVENTF_ABSOLUTE = 32768

DllCall("user32.dll", "none", "mouse_event", _

"long", $MOUSEEVENTF_MOVE + ($absolute*$MOUSEEVENTF_ABSOLUTE), _

"long", $X, _

"long", $Y, _

"long", 0, _

"long", 0)

EndFunc

$X = 500

$Y = 500

HotKeySet("{PAUSE}", "start")

HotKeySet("{ESC}", "quit")

Func start()

_MouseMovePlus($X*(65535/@DesktopWidth), $Y*(65535/@DesktopHeight),1)

EndFunc

Func quit()

Exit 0

EndFunc

While 1

Sleep(10)

WEnd

It works now on Windows Desktop but not in the Game -.-

Edited by TomCat

Share this post


Link to post
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
Sign in to follow this  
Followers 0