Need help with a script that records mouse position and moves mouse automatically.
Re: Need help with a script that records mouse position and moves mouse automatically.
@gyrosav
Its because BlockInput at line 40-42, i put that because as you said, when u accidently moving the cursor when it automaticly moving, it will mess up the progress, you can just remove line 40-42 to fix it
Its because BlockInput at line 40-42, i put that because as you said, when u accidently moving the cursor when it automaticly moving, it will mess up the progress, you can just remove line 40-42 to fix it
My Creations
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
ControlProcess
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
Re: Need help with a script that records mouse position and moves mouse automatically.
@off
Yes, I love the block input but sometimes it remains blocked forever. I have to open the task manager to end the AHK because it makes everything stop working. I want the block input but can you make it so that it doesn't remain blocked forever?
Yes, I love the block input but sometimes it remains blocked forever. I have to open the task manager to end the AHK because it makes everything stop working. I want the block input but can you make it so that it doesn't remain blocked forever?
Re: Need help with a script that records mouse position and moves mouse automatically.
@gyrosav
Maybe you need to put line 58 before line 56
The code will be
Maybe you need to put line 58 before line 56
The code will be
Code: Select all
BlockInput, Off
BlockInput, MouseMoveOff
BlockInput, Default
My Creations
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
ControlProcess
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
Re: Need help with a script that records mouse position and moves mouse automatically.
@off
hmm i tried this but it locked up my computer. I couldnt do anything. I had to kill the AHK script to get mouse and keyboard working again. Can you take a look?
hmm i tried this but it locked up my computer. I couldnt do anything. I had to kill the AHK script to get mouse and keyboard working again. Can you take a look?
Re: Need help with a script that records mouse position and moves mouse automatically.
@off
I need the block input. without it the script is also erratic. but the block input is 100% sometimes making an error and not stopping the block input. please help! =)
I need the block input. without it the script is also erratic. but the block input is 100% sometimes making an error and not stopping the block input. please help! =)
Re: Need help with a script that records mouse position and moves mouse automatically.
@gyrosav
Sorry, i cannot reproduce your issue.
This script works perfectly without locking any key, mouse, anything.
viewtopic.php?p=513031#p513031
But yeah, maybe it is caused by different computer
Sorry, i cannot reproduce your issue.
This script works perfectly without locking any key, mouse, anything.
viewtopic.php?p=513031#p513031
But yeah, maybe it is caused by different computer
My Creations
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
ControlProcess
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
Re: Need help with a script that records mouse position and moves mouse automatically.
@off
No problem! Thank you sir!!!
No problem! Thank you sir!!!
Re: Need help with a script that records mouse position and moves mouse automatically.
@off
Off, can you take another look? It 100% locks sometimes. It won't let me do anything. I need the block input but is there another way to make it so that it doesn't break the AHK? Mouse clicks or key presses stop working completely forever. The only way to fix it is if I CTRL-ALT-DELETE and end task the AHK. Please help.
Off, can you take another look? It 100% locks sometimes. It won't let me do anything. I need the block input but is there another way to make it so that it doesn't break the AHK? Mouse clicks or key presses stop working completely forever. The only way to fix it is if I CTRL-ALT-DELETE and end task the AHK. Please help.
Code: Select all
#NoEnv
#KeyHistory
SetBatchLines -1
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance Force
CoordMode, Mouse, Client
Gui, +AlwaysOnTop +ToolWindow
Gui, Font, S8, Verdana
Gui, Add, Text, xm y+10 Section, X:
Gui, Add, Edit, YS-3 x36 vX Disabled Center
Gui, Add, Text, xm y+10 Section, Y:
Gui, Add, Edit, YS-3 x36 vY Disabled Center
Gui, Add, Text, xm, Press y to Record
Gui, Add, Text, xm, Press CTRL+v to Replay
Gui, Show,, Mouse Replay
Return
Record:
Return
+c::
+v::
Gui, Submit, NoHide
; MsgBox, %X% %Y%
If (X="") or (Y="")
{
MsgBox, Please record mouse position first.
Return
}
Else
{
BlockInput, On
BlockInput, MouseMove
BlockInput, Mouse
SendInput, {Click Left 1} ; using SendInput to prevent Clicking with Shift
Sleep, 1
;Click, Left Up ; send mouse button up, to prevent "dragging" mouse move
;Click, Right Up
Sleep, 1
MouseGetPos, SaveX, SaveY ; save current position
Gui, Submit, NoHide
;MouseClick, Right, % X, % Y, 1, 1
MouseMove, %X%, %Y%, 0 ; using Combination from MouseMove and basic Click to improve the restore process
Click, Right, 1
Sleep, 1 ; delay between click and restoring position
MouseMove, %SaveX%, %SaveY%, 0 ; restore position
Sleep, 1 ; delay before activating mouse input
BlockInput, MouseMoveOff
BlockInput, Default
BlockInput, Off
}
Return
MButton::
SetTimer, ToolTip, 10
KeyWait, Lbutton, Down
MouseGetPos, MouseX, MouseY
GuiControl,,X, % MouseX
GuiControl,,Y, % MouseY
SetTimer, ToolTip, OFF
ToolTip
Return
ToolTip:
ToolTip Waiting for click...
Return
GuiClose:
GuiEscape:
ExitApp
Return
Re: Need help with a script that records mouse position and moves mouse automatically.
@gyrosav
I cant get your issues, perhaps anyone else can help you..
So sorry
Edit :
If i pick the coordinate to be the gui window, it freezes, maybe you can try to send a screenshot or a gif showing your problem..
I cant get your issues, perhaps anyone else can help you..
So sorry
Edit :
If i pick the coordinate to be the gui window, it freezes, maybe you can try to send a screenshot or a gif showing your problem..
My Creations
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
ControlProcess
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key