DLL Related - MouseMove [GAME]

Ask gaming related questions (AHK v1.1 and older)
frost jack
Posts: 8
Joined: 19 Jun 2016, 07:09

DLL Related - MouseMove [GAME]

11 Aug 2018, 03:57

hello guys , can someone help me with DLL things ? i didnt use ahk since a long time
can u post a script of moving mouse to a position using dll ?
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: DLL Related - MouseMove [GAME]

11 Aug 2018, 05:01

Why do you need dll for mouse move?
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
frost jack
Posts: 8
Joined: 19 Jun 2016, 07:09

Re: DLL Related - MouseMove [GAME]

11 Aug 2018, 08:47

i want to automate a strategy game but mousemove does not seem to work.
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: DLL Related - MouseMove [GAME]

11 Aug 2018, 09:14

Try mouse_event or SendInput (see this last link for examples).
frost jack
Posts: 8
Joined: 19 Jun 2016, 07:09

Re: DLL Related - MouseMove [GAME]

11 Aug 2018, 12:23

so many thanks flipador
frost jack
Posts: 8
Joined: 19 Jun 2016, 07:09

Re: DLL Related - MouseMove [GAME]

11 Aug 2018, 12:28

tried it before , but it keeps moving the mouse every time by %x% unit , i just want to move mouse straight to some x axis and y axis, then move it to another location
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: DLL Related - MouseMove [GAME]

11 Aug 2018, 12:36

show what youve tried, what doesnt work and how it doesnt work. otherwise, people will have to keep guessing, which is rather... wasteful.
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: DLL Related - MouseMove [GAME]

11 Aug 2018, 13:27

You can try something like this:

Code: Select all

Move(X, Y)
{
    DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", -9999, "UInt", -9999, "UInt", 0, "UPtr", 0)
    DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", X, "UInt", Y, "UInt", 0, "UPtr", 0)
}


MsgBox % Move(100, 50)
MsgBox % Move(100, 50)
MsgBox % Move(500, 350)
MsgBox % Move(500, 350)
MsgBox % Move(750, 500)
MsgBox % Move(750, 500)
frost jack
Posts: 8
Joined: 19 Jun 2016, 07:09

Re: DLL Related - MouseMove [GAME]

11 Aug 2018, 17:56

Thank you , ill try it
LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Re: DLL Related - MouseMove [GAME]

12 Jan 2023, 11:41

@Flipeador I like your script, but it rendered this error: Call to nonexistent function. Could you please help me?

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 51 guests