TomCat Posted October 3, 2007 Share Posted October 3, 2007 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 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 Link to comment Share on other sites More sharing options...
TomCat Posted October 5, 2007 Author Share Posted October 5, 2007 Nobody can help me ? Link to comment Share on other sites More sharing options...
narayanjr Posted October 5, 2007 Share Posted October 5, 2007 ive never used the function but what are the values of $x and $y? and what is the error that you get? Link to comment Share on other sites More sharing options...
TomCat Posted October 5, 2007 Author Share Posted October 5, 2007 (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 October 5, 2007 by TomCat Link to comment Share on other sites More sharing options...
eltorro Posted October 5, 2007 Share Posted October 5, 2007 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. Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
TomCat Posted October 5, 2007 Author Share Posted October 5, 2007 (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 October 8, 2007 by TomCat Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now