Opt("WinTitleMatchMode", 4)
Opt("TrayIconHide", 1)
HotKeySet("{F9}", "GetPos")
HotKeySet("{F10}", "GetPos1")
HotKeySet("{Esc}", "x")
HotKeySet("{PAUSE}", "TogglePause")
$G_SZVERSION = "Auto VFT"
If WinExists($G_SZVERSION) Then
MsgBox(0 + 48 + 262144, "Warning", "程序已开启,请勿重复运行!")
Exit
EndIf
AutoItWinSetTitle($G_SZVERSION)
FileInstall('top.jpg', @TempDir & "\top.jpg ", 1)
Dim $FORM1, $FORM2, $FORM3, $LABELERROR
$FORM1 = GUICreate("Auto Notifier VeriFire Tools", 400, 300, - 1, - 1, - 1, $WS_EX_LAYERED)
GUICtrlSetDefBkColor($GUI_BKCOLOR_TRANSPARENT, $FORM1)
$PIC1 = GUICtrlCreatePic(@TempDir & "\top.jpg ", 0, 0, 400, 80)
GUICtrlSetState(- 1, $GUI_DISABLE)
$LABELTEXT = GUICtrlCreateLabel("", 2, 85, 197, 55)
GUICtrlSetColor(- 1, 16777215)
GUICtrlSetBkColor($LABELTEXT, 1810914)
GUICtrlSetFont(- 1, 10, 800, 0, "宋体")
TIME()
AdlibRegister("time", 1000)
$LABELERROR = GUICtrlCreateLabel("", 6, 95, 197, 50)
GUICtrlSetColor(- 1, 16777215)
GUICtrlSetFont(- 1, 10, 600, 0, "宋体")
$GROUP1 = GUICtrlCreateGroup("", 2, 77, 197, 187)
$RADIO1 = GUICtrlCreateRadio("模式Ⅰ", 10, 240, 80, 17)
GUICtrlSetState($RADIO1, $GUI_CHECKED)
$LABEL1 = GUICtrlCreateLabel(" X 坐标:", 6, 155, 60, 20)
$INPUT1 = GUICtrlCreateInput("", 60, 152, 38, 18, $ES_READONLY)
$LABEL2 = GUICtrlCreateLabel(" Y 坐标:", 102, 155, 60, 20)
$INPUT2 = GUICtrlCreateInput("", 156, 152, 38, 18, $ES_READONLY)
$LABEL3 = GUICtrlCreateLabel("结束坐标:", 6, 183, 60, 20)
$INPUT3 = GUICtrlCreateInput("", 60, 180, 38, 18, $ES_READONLY)
$LABEL4 = GUICtrlCreateLabel("移动间隔:", 102, 183, 60, 20)
$INPUT4 = GUICtrlCreateInput("19", 156, 180, 38, 18, $ES_NUMBER)
$LABEL5 = GUICtrlCreateLabel("鼠标速度:", 6, 211, 60, 20)
$INPUT5 = GUICtrlCreateInput("50", 60, 208, 38, 18, $ES_NUMBER)
$LABEL6 = GUICtrlCreateLabel("暂停时间:", 102, 211, 60, 20)
$INPUT6 = GUICtrlCreateInput("2", 156, 208, 38, 18, $ES_NUMBER)
$BUTTON3 = GUICtrlCreateButton("测试", 140, 238, 55, 20)
GUICtrlCreateGroup("", +4294967197, +4294967197, 1, 1)
$EDIT1 = GUICtrlCreateEdit("", 201, 84, 197, 179, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY))
GUICtrlSetFont($EDIT1, 10, 400, 0, "宋体")
$LOG_ = "------------------------"
GUICtrlSetData($EDIT1, "使用说明:" & @CRLF & @CRLF & "[F9]选择起始坐标位置;" & @CRLF & "[F10]选择结束坐标位置。" & @CRLF & "“移动间隔”单位为像素;" & @CRLF & "“鼠标速度”取值为0-100(包含),速度递减。" & @CRLF & "“暂停时间”单位为秒,且不超过100。" & @CRLF & $LOG_ & @CRLF & "温馨提示:" & @CRLF & "“ESC”中止程序," & @CRLF & "“Pause Break”暂停程序。" & @CRLF & $LOG_ & @CRLF & "备注:" & @CRLF & "程序仅适用于“Notifier VeriFire Tools”设置。" & @CRLF & $LOG_)
GUICtrlCreateLabel("", 0, 266, 400, 0, $SS_ETCHEDHORZ)
$BUTTON1 = GUICtrlCreateButton("确定(&O)", 242, 275, 75, 25)
$BUTTON2 = GUICtrlCreateButton("取消(&C)", 322, 275, 75, 25)
If @OSVersion = "WIN_7" Or @OSVersion = "WIN_8" Then _GUI()
GUISetState(@SW_SHOW)
While 1
$NMSG = GUIGetMsg()
Select
Case $NMSG = $GUI_EVENT_CLOSE
Exit
Case $NMSG = $BUTTON1
GUICtrlSetState($BUTTON1, $GUI_DISABLE)
_send()
GUICtrlSetState($BUTTON1, $GUI_ENABLE)
Case $NMSG = $BUTTON2
Exit
Case $NMSG = $BUTTON3
GUICtrlSetState($BUTTON3, $GUI_DISABLE)
_send()
GUICtrlSetState($BUTTON3, $GUI_ENABLE)
EndSelect
WEnd
Func _send()
Select
Case @error
ERR()
GUICtrlSetData($LABELERROR, @error)
Case GUICtrlRead($INPUT4) = "0" Or GUICtrlRead($INPUT4) = ""
ERR()
GUICtrlSetData($LABELERROR, ":( “移动间隔”格式错误。" & @CRLF & "" & @CRLF & "注:不能为空或“0”。")
Case GUICtrlRead($INPUT5) > 100
ERR()
GUICtrlSetData($LABELERROR, ":( “鼠标速度”格式错误。" & @CRLF & "" & @CRLF & "注:值为0-100(包含)。")
Case StringIsDigit(GUICtrlRead($INPUT6)) = 0
ERR()
GUICtrlSetData($LABELERROR, ":( “暂停时间”格式错误。" & @CRLF & "" & @CRLF & "注:只能为数字。(12345...)")
Case Else
TIME()
AdlibRegister("time", 1000)
GUICtrlSetBkColor($LABELTEXT, 1810914)
GUICtrlSetData($LABELERROR, "")
If GUICtrlGetState($BUTTON1) = "144" Then RADIO1()
If GUICtrlGetState($BUTTON3) = "144" Then TEST()
EndSelect
EndFunc ;==>_SEND
Func RADIO1()
Sleep(GUICtrlRead($INPUT6) & "000")
For $X = GUICtrlRead($INPUT2) To GUICtrlRead($INPUT3) Step GUICtrlRead($INPUT4)
MouseMove(GUICtrlRead($INPUT1), $X, GUICtrlRead($INPUT5))
Sleep(100)
MouseClick("right")
Sleep(100)
Send("{DOWN}")
Sleep(100)
Send("{DOWN}")
Sleep(100)
Send("{enter}")
Sleep(500)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{LEFT}")
Sleep(100)
Send("{enter}")
Sleep(100)
Send("{DOWN}")
Next
EndFunc ;==>RADIO1
Func TIME()
GUICtrlSetData($LABELTEXT, " DATE|TIME:" & @CRLF & @CRLF & @CRLF & " " & _NowCalc() & " " & _DateDayOfWeek(@WDAY, 1))
EndFunc ;==>TIME
Func ERR()
AdlibUnRegister("time")
GUICtrlSetData($LABELTEXT, "")
GUICtrlSetBkColor($LABELTEXT, 43945)
EndFunc ;==>ERR
Func TEST()
Sleep(GUICtrlRead($INPUT6) & "000")
For $X = GUICtrlRead($INPUT2) To GUICtrlRead($INPUT3) Step GUICtrlRead($INPUT4)
MouseMove(GUICtrlRead($INPUT1), $X, GUICtrlRead($INPUT5))
Sleep(100)
Next
EndFunc ;==>TEST
Func TOGGLEPAUSE()
Local $PAUSED
$PAUSED = Not $PAUSED
While $PAUSED
Sleep(100)
ToolTip("脚本已经" 暂停"了,按" ESC"退出。", 0, 0)
WEnd
ToolTip("")
EndFunc ;==>TOGGLEPAUSE
Func X()
Exit
EndFunc ;==>X
Func GETPOS()
Local $APOS = MouseGetPos()
GUICtrlSetData($INPUT1, $APOS[0])
GUICtrlSetData($INPUT2, $APOS[1])
EndFunc ;==>GETPOS
Func GETPOS1()
Local $APOS = MouseGetPos()
GUICtrlSetData($INPUT3, $APOS[1])
EndFunc ;==>GETPOS1
Func _GUI()
GUISetBkColor(11259375)
_WinAPI_SetLayeredWindowAttributes($FORM1, 11259375)
$MARGINS = DllStructCreate("int;int;int;int")
DllStructSetData($MARGINS, 1, - 1)
DllCall("dwmapi.dll", "none", "DwmExtendFrameIntoClientArea", "hwnd", $FORM1, "ptr", DllStructGetPtr($MARGINS))
EndFunc ;==>_GUI