#include <Misc.au3>
HotKeySet("{ESC}", "Quit")
FileDelete("script.au3")
$t = TimerInit()
While Sleep(10)
If _IsPressed("01") Then
FileWriteLine("script.au3", "Sleep(" & Round(TimerDiff($t)) & ")")
FileWriteLine("script.au3", "MouseClick('left', " & MouseGetPos(0) & ", " & MouseGetPos(1) & ", 1, 0)")
Do
Until Not _IsPressed("01")
$t = TimerInit()
EndIf
WEnd
Func Quit()
Exit
EndFunc
#include <Misc.au3>
HotKeySet("{ESC}", "Quit")
FileDelete("script.au3")
$t = TimerInit()
While Sleep(10)
If _IsPressed('01') Then
FileWriteLine("script.au3", "Sleep(" & Round(TimerDiff($t)) & ")")
FileWriteLine("script.au3", "MouseClick('left', " & MouseGetPos(0) & ", " & MouseGetPos(1) & ", 1, 0) ;" & InputBox("куда нажал?", "куда?", "пиши сходу, окно активно", "",300, 150, 800, 400) &"")
Do
Until Not _IsPressed('01')
$t = TimerInit()
EndIf
WEnd
Func Quit()
Exit
EndFunc
Можно, т.к. InputBox() блокирует цикл.окей нельзя нажимать мышкой
простой вариант детекта mousedrag
#include <Misc.au3>
HotKeySet("{ESC}", "Quit")
FileDelete("script.au3")
Global $t = TimerInit(), $start, $stop
While Sleep(10)
If _IsPressed('01') Then
$start = MouseGetPos()
FileWriteLine("script.au3", "Sleep(" & Round(TimerDiff($t)) & ")")
Do
Sleep(10)
Until Not _IsPressed('01')
$stop = MouseGetPos()
If $start[0] = $stop[0] And $start[1] = $stop[1] Then
FileWriteLine("script.au3", "MouseClick('left', " & $start[0] & ", " & $start[1] & ", 1, 0) ; " & InputBox("куда нажал?", "куда?", "пиши сходу, окно активно", "", 300, 150, 800, 400))
Else
FileWriteLine("script.au3", "MouseClickDrag('left', " & $start[0] & ', ' & $start[1] & ', ' & $stop[0] & ', ' & $stop[1] & ') ; ' & WinGetTitle("[active]"))
EndIf
$t = TimerInit()
EndIf
WEnd
Func Quit()
Exit
EndFunc
Запустить, накликать ЛКМ (в появляющемся окне можно вписывать комментарии - куда кликнули), нажать ESC.как именно на практике этим скриптом воспользоваться
Просто не заметил, что в том же каталоге и будет записанный скрипт....Запустить полученный script.au3 для воспроизведения записанных кликов.
Здравствуйте! Не подскажите, а если мне надо фиксировать клики и sleep только в определенных координатах: (x=201,y=65) верхний угол, (x=591,y=455) нижний угол, а не все нажатия по экрану?Код:#include <Misc.au3> HotKeySet("{ESC}", "Quit") FileDelete("script.au3") $t = TimerInit() While Sleep(10) If _IsPressed("01") Then FileWriteLine("script.au3", "Sleep(" & Round(TimerDiff($t)) & ")") FileWriteLine("script.au3", "MouseClick('left', " & MouseGetPos(0) & ", " & MouseGetPos(1) & ", 1, 0)") Do Until Not _IsPressed("01") $t = TimerInit() EndIf WEnd Func Quit() Exit EndFunc
Как это можно реализовать?
#include <Misc.au3>
HotKeySet("{ESC}", "Quit")
FileDelete("script.au3")
$t = TimerInit()
Global $x1 = 201, $y1 = 65 ; левый верх
Global $x2 = 591, $y2 = 455 ; правый низ
While Sleep(10)
If _IsPressed("01") Then
$pos = MouseGetPos()
If $pos[0] >= $x1 And $pos[1] >= $y1 And $pos[0] <= $x2 And $pos[1] <= $y2 Then
FileWriteLine("script.au3", "Sleep(" & Round(TimerDiff($t)) & ")")
FileWriteLine("script.au3", "MouseClick('left', " & MouseGetPos(0) & ", " & MouseGetPos(1) & ", 1, 0)")
EndIf
Do
Until Not _IsPressed("01")
$t = TimerInit()
EndIf
WEnd
Func Quit()
Exit
EndFunc
#include <Misc.au3>
HotKeySet("{ESC}", "Quit")
FileDelete("script.au3")
$t = TimerInit()
Global $x1 = 201, $y1 = 65 ; левый верх
Global $x2 = 591, $y2 = 455 ; правый низ
While Sleep(10)
If _IsPressed("01") Then
$pos = MouseGetPos()
If $pos[0] >= $x1 And $pos[1] >= $y1 And $pos[0] <= $x2 And $pos[1] <= $y2 Then
FileWriteLine("script.au3", "Sleep(" & Round(TimerDiff($t)) & ")")
FileWriteLine("script.au3", "MouseClick('left', " & MouseGetPos(0) & ", " & MouseGetPos(1) & ", 1, 0)")
EndIf
Do
Until Not _IsPressed("01")
$t = TimerInit()
EndIf
WEnd
Func Quit()
Exit
EndFunc
#include <Misc.au3>
#include <Date.au3>
HotKeySet("{ESC}", "Quit")
FileDelete("script.au3")
$t = TimerInit()
Global $x1 = 201, $y1 = 65 ; левый верх
Global $x2 = 591, $y2 = 455 ; правый низ
While Sleep(10)
If _IsPressed("01") Then
$pos = MouseGetPos()
If $pos[0] >= $x1 And $pos[1] >= $y1 And $pos[0] <= $x2 And $pos[1] <= $y2 Then
FileWriteLine("script.au3", _DateTimeFormat( _NowCalc(),0) & "Sleep(" & Round(TimerDiff($t)) & ")")
FileWriteLine("script.au3", _DateTimeFormat( _NowCalc(),0) & "MouseClick('left', " & MouseGetPos(0) & ", " & MouseGetPos(1) & ", 1, 0)")
EndIf
Do
Until Not _IsPressed("01")
$t = TimerInit()
EndIf
WEnd
Func Quit()
Exit
EndFunc
добавить дату в формате (14.05.2021 19:37:15) в строку MouseClick
FileWriteLine("script.au3", "MouseClick('left', " & MouseGetPos(0) & ", " & MouseGetPos(1) & ", 1, 0) ; " & @MDAY & "." & @MON & "." & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC)