鼠标按键精灵(源码 + 程序)

更新时间:2023-05-25 17:31:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

鼠标按键精灵

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#AutoIt3Wrapper_Res_Description=MarinaClick
#AutoIt3Wrapper_Res_Fileversion=1.01Beta
#AutoIt3Wrapper_Res_Language=English

#Region ### START Koda GUI section ### Form=

HotKeySet("{F1}", "Focus")
HotKeySet("{F2}", "Active")
HotKeySet("{F3}", "Pause")
HotKeySet("{ESC}", "Terminate")

Global $pos, $index, $target, $locked = 0, $flag = 1, $inf = 0

$Form2 = GUICreate("MarinaClick", 270, 160, 270, 150)
$Input1 = GUICtrlCreateInput("5", 112, 8, 41, 21)
$Label1 = GUICtrlCreateLabel("Set Delay:", 32, 8, 76, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$Label2 = GUICtrlCreateLabel("Seconds", 160, 8, 66, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$Label3 = GUICtrlCreateLabel("F1 = Focus | F2 = Active | F3 = Pause", 20, 80, 260, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
$Label4 = GUICtrlCreateLabel("Current Statue:", 20, 107, 108, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$Label5 = GUICtrlCreateLabel("Standby", 150, 100, 97, 34)
GUICtrlSetFont(-1, 16, 800, 0, "Arial Black")
GUICtrlSetColor(-1, 0x008000)
$Label6 = GUICtrlCreateLabel("Repeat:", 48, 32, 59, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$Input2 = GUICtrlCreateInput("10", 112, 32, 41, 21)
$Label7 = GUICtrlCreateLabel("Times", 160, 32, 47, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$Label7 = GUICtrlCreateLabel("Leave blank for Infinite-Loop mode", 35, 56, 260, 22)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Progress1 = GUICtrlCreateProgress(5, 135, 260, 10)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

Func Focus()
$pos = MouseGetPos()
$locked = 1
GUICtrlSetData($Label5, "Ready")
TrayTip("Tips", "Position Locked -- ("&$pos[0]&","&$pos[1]&")", 5, 1)
EndFunc

Func Terminate()
Exit
EndFunc

Func Active()
If $locked <> 1 Then
MsgBox(16, "Warning", "Pls focus on a click position by pressin' [F1] bfr activing process.")
Else
LoopBlock()
EndIf
EndFunc

Func LoopBlock()
TrayTip("Tips", "Working in progress...", 5, 1)
GUICtrlSetData($Label5, "Actived")
If GUICtrlRead($Input2) <> "" Then
Loop()
Else
InfLoop()
EndIf

;ProgData()
GUICtrlSetData($Label5, "Standby")
GUICtrlSetData($Progress1, 0)
TrayTip("Tips", "Process finished", 5, 1)
EndFunc

Func ProgData()
GUICtrlSetData($Progress1, $index*100/$target)
EndFunc

Func Loop()

$index = 1
$target = GUICtrlRead($Input2)
While $index <> $target+1
ProgData()
MouseClick("left", $pos[0], $pos[1])
sleep(G

鼠标按键精灵

UICtrlRead($Input1)*1000)
$index += 1
WEnd
$locked = 0
EndFunc

Func InfLoop()
$inf = 1
While $flag
MouseClick("left", $pos[0], $pos[1])
sleep(GUICtrlRead($Input1)*1000)
WEnd
$flag = 1
$inf = 0
EndFunc

Func Pause()
If $inf = 1 Then
$flag = 0
Else
MsgBox(16, "Warning", "Pause function,[F3], could ONLY be used under Infinite-mode.")
EndIf
EndFunc

本文来源:https://www.bwwdw.com/article/0f54.html

Top