Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Misc.au3>
- Local $hDLL = DllOpen("user32.dll")
- HotKeySet("{F3}", "Terminate")
- Func Terminate()
- StopRecordPath()
- Exit 0
- EndFunc
- Func main()
- Global $timesleep = InputBox("Record mouse movement each X ms","Record each x Miliseconds. Hold middle mouse btn to keep recording. Release to stop. F3 will save and exit.",100)
- if @error = 1 then Exit
- Global $file = FileOpen("MyPath.au3", 2)
- If $file = -1 Then
- MsgBox(0, "Error", "Unable to open file.")
- Exit
- EndIf
- FileWrite($file, "func MyPath()" & @CRLF)
- FileWriteLine($file, 'MouseDown("middle")')
- while 1
- while _IsPressed(04,$hDLL)
- RecordPath()
- WEnd
- WEnd
- EndFunc
- Func RecordPath()
- $grava = MouseGetPos()
- Sleep($timesleep)
- FileWriteLine($file, 'MouseMove('& $grava[0] & ' + Random(1,3),' & $grava[1] & ' + Random(1,3),1)')
- FileWriteLine($file, 'Sleep(' & $timesleep & ')')
- ;~ FileWriteLine($file, 'Sleep(' & $timesleep & ' + Random(1,3))')
- EndFunc
- Func StopRecordPath()
- FileWriteLine($file, 'MouseUp("middle")')
- FileWrite($file, "endfunc" & @CRLF)
- FileWrite($file, "sleep(7000)" & @CRLF)
- FileWrite($file, "MyPath()" & @CRLF)
- FileClose($file)
- EndFunc
- main()
Advertisement
Add Comment
Please, Sign In to add comment