Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Trying to move the mouse down from current position


  • Please log in to reply
2 replies to this topic
DarkKitty7
  • Members
  • 53 posts
  • Last active: Mar 13 2016 09:09 AM
  • Joined: 17 Mar 2013

Hii.. I'm trying to move the mouse downward exactly 10 pixels from whatever its current position is upon the second press of my hot key here, However when I press it a second time nothing at all happens. (the camera wont move, and if i enable the mouse to test it further, the mouse wont move either when i press the hotkey)

 

One other note is that: This is for a game which usually has the mouse 'invisible' and located dead center of the screen while moving the camera around. I think something like a_screenwidth + a_screenheight divided by 2  would get the correct formula but I'm not sure about that really, as I can't even get the mouse to move with my current script here.

 

I'm thinking since maybe the mouse is "hidden" while the camera moves, maybe the MouseGetPos  won't register?

$g::
MouseGetPos, MouseX, MouseY
if (A_ThisHotkey=A_PriorHotkey && A_TimeSincePriorHotkey <= 2000)
    Light++
else
    Light := 1

If Light > 2
Light := 1



if (Light = 1)
{
Send 2
}    
if (Light = 2)
{
								BlockInput, on
								MouseMove, %MouseX%, %MouseY%+10, 3
								Click Right
								BlockInput, off
}
Return


Xtra
  • Members
  • 954 posts
  • Last active: Jul 23 2016 09:04 PM
  • Joined: 29 Sep 2013
$g::
if (A_ThisHotkey=A_PriorHotkey && A_TimeSincePriorHotkey <= 2000)
    Light++
else
    Light := 1

If Light > 2
    Light := 1

if (Light = 1)
    Send 2
 
if (Light = 2)
{
	BlockInput, on
	MouseMove, 0, 10, 3, R
	    Click Right
	BlockInput, off
}
Return

No need to use mousegetpos above uses mousemove relative (R parameter) from its current pos.(ie Y+10)

Also you will have trouble using %var% in your mousemove, this command accepts expressions so no %'s needed.

 

 

If your still having problems i added below for reference.

BlockInput, on
    MouseMove, A_ScreenWidth/2, A_ScreenHeight/2+10, 3
    Click Right
BlockInput, off

HTH



DarkKitty7
  • Members
  • 53 posts
  • Last active: Mar 13 2016 09:09 AM
  • Joined: 17 Mar 2013

This is perfect, Thank you!