hufyhang 发表于 2009-5-2 16:01:37

鼠标按键精灵

#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&","&$pos&")", 5, 1)
EndFunc

Func Terminate()
        Exit
EndFunc

Func Active()
        If $locked <> 1 Then
                MsgBox(16, "Warning", "Pls focus on a click position by pressin' 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, $pos)
                sleep(GUICtrlRead($Input1)*1000)
                $index += 1
        WEnd
        $locked = 0
EndFunc

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

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

stch 发表于 2009-5-6 22:54:58

謝謝提供!!!!

bgoo2008 发表于 2009-5-6 23:34:41

谢谢lz分享!

urwk 发表于 2010-1-3 15:11:16

。。。。。。。。。。。。

qvvcity 发表于 2010-2-8 20:59:40

看一看,谢谢

Gray 发表于 2010-8-30 15:18:20

不知道这个是用来干嘛的~~

ollydbg 发表于 2010-10-6 17:46:25

这个怎么用啊

jianganew 发表于 2010-11-1 21:26:45

下来看看,谢谢了

迷龙88 发表于 2012-5-6 13:32:52

謝謝提供!!!!

hzcjd 发表于 2012-6-13 14:43:34

这个怎么使用 不懂

ashfinal 发表于 2012-6-14 10:48:35

原来写过一个完整版的 弄丢了 也懒的写了 {:face (207):}

haijie1223 发表于 2012-6-14 10:53:53

标记一下,谢谢分享

jkl642359 发表于 2012-6-22 15:33:54

最快是多少?

jkl642359 发表于 2012-6-22 15:35:53

{:face (319):}怎么是英文的啊,还会报错

water197 发表于 2012-11-15 16:14:24

dddddddddddddddddddddddddddddddddddddddw
页: [1] 2
查看完整版本: 鼠标按键精灵