2008年12月24日 星期三

滑鼠點擊器.au3

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


;_ScreenCapture_SetJPGQuality(90)
dim $guix1,$guix2,$guiy1,$guiy2
dim $guiactivetitle
dim $SIZEY,$pointy,$SIZEX
dim $Button_start , $fnken
dim $x1,$x2,$y1,$y2
dim $fken

HotKeySet("{F7}", "GETP1") ; 定位點1
HotKeySet("{F8}", "GETP2") ; 定位點2
HotKeySet("{f6}", "NO") ; stop
HotKeySet("{f5}", "DOLOOP") ; do
HotKeySet("{esc}", "EX") ;esc 離開


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("點對點 滑鼠點擊器", 393, 170, 326, 196)
$guix1 = GUICtrlCreateInput("", 32, 8, 121, 21)
$guiy1 = GUICtrlCreateInput("", 184, 8, 121, 21)
$guix2 = GUICtrlCreateInput("", 32, 40, 121, 21)
$guiy2 = GUICtrlCreateInput("", 184, 40, 121, 21)
$Label1 = GUICtrlCreateLabel("X1", 8, 8, 17, 17)
$Label2 = GUICtrlCreateLabel("Y1", 168, 8, 17, 17)
$Label3 = GUICtrlCreateLabel("X2", 8, 40, 17, 17)
$Label4 = GUICtrlCreateLabel("Y2", 168, 40, 17, 17)
$Label5 = GUICtrlCreateLabel("F7定位", 320, 8, 40, 17)
$Label6 = GUICtrlCreateLabel("F8定位", 320, 40, 40, 17)
$Label7 = GUICtrlCreateLabel("F5 開始", 8, 80, 43, 17)
$Label8 = GUICtrlCreateLabel("F6 停止", 64, 80, 43, 17)
$Label9 = GUICtrlCreateLabel("ESC 離開", 112, 80, 52, 17)
$Label10 = GUICtrlCreateLabel("次數 不輸入代表無限大", 8, 112)
$looptime = GUICtrlCreateInput("", 40, 140, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



While 1

WEnd

GUISetState(@SW_SHOW)

$i =0

While 1
Sleep(100)
WEnd

func down()
$i =0
Do
MouseDown ( "LEFT" )
SLEEP (10)
Until $i = 1
EndFunc

func DOLOOP()
$x1 = GUICtrlRead($guix1)
$y1 = GUICtrlRead($guiy1)
$x2 = GUICtrlRead($guix2)
$y2 = GUICtrlRead($guiy2)
$I = 0
msgbox ("","",GUICtrlRead($looptime))
if GUICtrlRead($looptime) = '' Then
While $I = 0
MouseMove ( $X1,$Y1)
SLEEP (1000)
MouseClick("left")
MouseMove ( $X2,$Y2)
SLEEP (1000)
MouseClick("left")
WEnd
Else
While GUICtrlRead($looptime) > $i
MouseMove ( $X1,$Y1)
SLEEP (100)
MouseClick("left")
MouseMove ( $X2,$Y2)
SLEEP (100)
MouseClick("left")
$i +=1
WEnd
EndIf

EndFunc

FUNC NO()
if GUICtrlRead($guiy2) <> '' Then
$i=1
Else
$i = GUICtrlRead($looptime) +10
EndIf
EndFunc

func GETP1()
$pos = MouseGetPos()
GUICtrlSetData ($guix1,$pos[0])
GUICtrlSetData ($guiY1,$pos[1])
endfunc

func GETP2()
$pos = MouseGetPos()
GUICtrlSetData ($guiX2,$pos[0])
GUICtrlSetData ($guiY2,$pos[1])
endfunc


FUNC EX()
Exit

沒有留言:

RHEL install EPEL

  https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...