I wrote this macro to automate a task in a game, the problem is the mouse never comes back to the original position for some reason (it used to). I've also tried using MouseMoveRel but that did not solve the problem, please help
Label>Start
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMove>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMove>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMove>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMove>40,0
Press NP1
wait>0.25
press NP1
wait>1
MouseMove>-200,0
wait>1
Press NP1
wait>0.25
press NP1
wait>7
MouseMove>40,0
wait>1
Goto>Start
Label>End
MouseMove Problem
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
This code moves the mouse to position 40,0 but doesn't do anything to move it back to wherever it was before the script was started. To do that you can add code as follows:
//at top of script
GetCursorPos>origX,origY
... your code here
//at end of script
MouseMove>origX,origY
//at top of script
GetCursorPos>origX,origY
... your code here
//at end of script
MouseMove>origX,origY
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
I tried adding the extra code as you suggested, but the cursor just vanishes from the screen and nothing happens. Here's what I did:
Label>Start
GetCursorPos>origX,origY
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>40,0
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>-200,0
wait>1
Press NP1
wait>0.25
press NP1
wait>7
MouseMove>origX,origY
wait>1
Goto>Start
Label>End
Label>Start
GetCursorPos>origX,origY
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>40,0
wait>1
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>40,0
Press NP1
wait>0.25
press NP1
wait>1
MouseMoveRel>-200,0
wait>1
Press NP1
wait>0.25
press NP1
wait>7
MouseMove>origX,origY
wait>1
Goto>Start
Label>End