Dll

Ask gaming related questions (AHK v1.1 and older)
User avatar
Reloaded
Posts: 283
Joined: 25 Aug 2017, 08:48

Dll

11 Dec 2017, 08:33

Hello!,

I found a Script that simple move down the Mouse but! how can i make it moves the Mouse not down but up ? The Script need to use Dll if not its didnt work in the Game.
And the same with left and right.

Code: Select all

#NoEnv
SendMode Input

f::Suspend

~End::ExitApp

LCtrl & ~LButton::
Loop
	If GetKeyState("LButton", "LCtrl") {
		Sleep, 30
		moveAmount := (moveAmount = 2) ? 4 : 0
 		mouseXY(moveAmount,3.4)
		
	}
	else
	break
	
Return



mouseXY(x,y)
{
DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}
Thank you for repost!
User avatar
Spawnova
Posts: 555
Joined: 08 Jul 2015, 00:12
Contact:

Re: Dll

11 Dec 2017, 09:53

Only the first 3 parameters for mouse_event dll are important, the first being the type of mouse_event, first parameter is 1, which is the mouse move event, second and third parameter are x and y positions respectively.

However you already have a wrapper for that dll with mouseXY so to move the mouse you simply call mouseXY(xdir,ydir)

Code: Select all

;the larger the number the larger distance the mouse moves
mouseXY(1,0) ;moves the mouse right
mouseXY(0,1) ;moves the mouse down
mouseXY(-1,0) ;moves the mouse left
mouseXY(0,-1) ;moves the mouse up
User avatar
Reloaded
Posts: 283
Joined: 25 Aug 2017, 08:48

Re: Dll

11 Dec 2017, 10:15

Spawnova wrote:Only the first 3 parameters for mouse_event dll are important, the first being the type of mouse_event, first parameter is 1, which is the mouse move event, second and third parameter are x and y positions respectively.

However you already have a wrapper for that dll with mouseXY so to move the mouse you simply call mouseXY(xdir,ydir)

Code: Select all

;the larger the number the larger distance the mouse moves
mouseXY(1,0) ;moves the mouse right
mouseXY(0,1) ;moves the mouse down
mouseXY(-1,0) ;moves the mouse left
mouseXY(0,-1) ;moves the mouse up
Worked, thanks <3

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 76 guests