Jump to content

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

[Resolved]MouseMove Issue



  • Please log in to reply
2 replies to this topic
Xei
  • Members
  • 115 posts
  • Last active: Feb 11 2018 05:22 PM
  • Joined: 20 Jan 2012
The below script always runs the else case. I do not know why. Anyone have any ideas? The goal is to have it detect which direction the mouse is currently moving, and then move it in that direction by another 500 pixels.

~F8::
MouseGetPos, initialMouseX, initialMouseY
sleep 3000
MouseGetPos, currentMouseX, currentMouseY

if currentMouseX > initialMouseX
MouseMove, 500, 0, 7, R

else
MouseMove, -500, 0, 7, R

Return


Sjc1000
  • Members
  • 572 posts
  • Last active: Mar 11 2017 11:41 AM
  • Joined: 06 Feb 2012
✓  Best Answer
You need %'s around the second variable in the if.

~F8::
MouseGetPos, initialMouseX, initialMouseY
sleep 3000
MouseGetPos, currentMouseX, currentMouseY

if currentMouseX > %initialMouseX%
MouseMove, 500, 0, 7, R

else
MouseMove, -500, 0, 7, R

Return

Sjc1000 - Insert inspirational quote here!

PLEASE find me on the IRC if you have questions. I'm never on the forum anymore.

 


Xei
  • Members
  • 115 posts
  • Last active: Feb 11 2018 05:22 PM
  • Joined: 20 Jan 2012
Awww, thanks. It's been a while.