找回密码
 加入
搜索
查看: 9447|回复: 27

[原创] 鼠标按键精灵

 火.. [复制链接]
发表于 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[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(GUICtrlRead($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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-5-6 22:54:58 | 显示全部楼层
謝謝提供!!!!
发表于 2009-5-6 23:34:41 | 显示全部楼层
谢谢lz分享!
发表于 2010-1-3 15:11:16 | 显示全部楼层
。。。。。。。。。。。。

评分

参与人数 1金钱 -10 贡献 -1 收起 理由
afan -10 -1 恶意灌水,扣分警告!

查看全部评分

发表于 2010-2-8 20:59:40 | 显示全部楼层
看一看,谢谢
发表于 2010-8-30 15:18:20 | 显示全部楼层
不知道这个是用来干嘛的~~
发表于 2010-10-6 17:46:25 | 显示全部楼层
这个怎么用啊
发表于 2010-11-1 21:26:45 | 显示全部楼层
下来看看,谢谢了
发表于 2012-5-6 13:32:52 | 显示全部楼层
謝謝提供!!!!
发表于 2012-6-13 14:43:34 | 显示全部楼层
这个怎么使用 不懂
发表于 2012-6-14 10:48:35 | 显示全部楼层
原来写过一个完整版的 弄丢了 也懒的写了
发表于 2012-6-14 10:53:53 | 显示全部楼层
标记一下,谢谢分享
发表于 2012-6-22 15:33:54 | 显示全部楼层
最快是多少?
发表于 2012-6-22 15:35:53 | 显示全部楼层
怎么是英文的啊,还会报错
发表于 2012-11-15 16:14:24 | 显示全部楼层
dddddddddddddddddddddddddddddddddddddddw
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-3 15:32 , Processed in 0.079987 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表