Func HOT()
While 1
If PixelGetColor(740,366)=13677996 Then
MouseClick("left", 477, 487, 1,1)
ElseIf PixelGetColor(508,407)=16724940 Then
Send('{BS}')
EndIf
Sleep($Ran)
WEnd
EndFunc
HotKeySet('{F9}','HOT')
HotKeySet('{F10}','_return') ;F10返回
Global $return_flag = 0 ;返回标志
Global $run_flag = 0 ;运行中标志
$Ran = Random(2000,2300,100)
While 1
Sleep(2000)
WEnd
Func HOT()
if $run_flag <> 0 Then ;若运行标志不为0
Return ;直接返回
Else
$run_flag = 1 ;设置运行标志为1
EndIf
While 1
if $return_flag = 1 Then ;如果返回标志为1
$return_flag = 0 ;设置返回标志为0
Return ;返回
EndIf
If PixelGetColor(740,366)=13677996 Then
MouseClick("left", 477, 487, 1,1)
ElseIf PixelGetColor(508,407)=16724940 Then
Send('{BS}')
EndIf
Sleep($Ran)
WEnd
EndFunc
Func _return()
if $run_flag = 1 Then ;如果运行标志为1 表示hot 函数正在执行
$return_flag = 1 ;设置返回标志为1
$run_flag = 0 ;设置运行标志为0
EndIf
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d
;;;; Body of program would go here ;;;;
While 1
Sleep(100)
WEnd
;;;;;;;;
Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc
Func Terminate()
Exit 0
EndFunc
Func ShowMessage()
MsgBox(4096,"","This is a message.")
EndFunc