按键精灵脚本例子

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

//
VBS requestTimes = 0
VBS iPathTimes = 59
VBS iPath = 0
VBS iWant="f_f25_,f_f4_,f_f43_,f_f4_,f_ll_"
VBS iWant=iWant+",f_f5_,f_f16_,f_f23_,f_f30_,f_f40_,f_f45_,f_f46_,f_f47_,f_f52_"
VBS iWant=iWant+",f_yry,f_gg,f_bf,f_nn,f_xdt,f_xmy,f_ttsy"
VBS iNext="0,30,2,40,2,45,2,55,2,70,2,2,2"
VBS waitTime=Split(iNext,",")
VBS getMyFish = 0
//
While 1=1
If requestTimes>=11
VBS getMyFish = 0
VBS requestTimes = 1
VBS iPathTimes = iPathTimes + 1
Else
VBS requestTimes = requestTimes + 1
EndIf
If iPathTimes \ 30 mod 2 > 0
iPath = 4
Else
iPath = 4
EndIf
VBS filePath="\newCase"&iPath&"\hdprev"&requestTimes&".x-amf"
Gosub sendRequestData
Gosub findResponseHwnd
If requestTimes mod 2 > 0
Gosub fishCatcher
EndIf
Gosub closeResponseHwnd
If getMyFish = 1
If requestTimes<11
nextTime = waitTime(requestTimes)
Gosub waitNextRequest
Else
Gosub closeResponseHwnd
EndIf
Else
If requestTimes<9
nextTime = waitTime(requestTimes)
Gosub waitNextRequest
Else
requestTimes = 11
Gosub closeResponseHwnd
EndIf
EndIf
EndWhile
//
EndScript
//
Sub findResponseHwnd
VBS flgsTime = 1200
VBS resHwnd = 0
While resHwnd = 0
VBS flgsTime = flgsTime - 1
Plugin resHwnd = Window.Find(0,"Response")
If resHwnd = 0
Delay 100
EndIf
If flgsTime < 0
VBS resHwnd = -1
EndIf
EndWhile
If resHwnd = -1
Gosub sendRequestData
Gosub findResponseHwnd
EndIf
Return
//
Sub closeResponseHwnd
VBS resHwnd = 0
VBS mainHwnd = 0
Plugin resHwnd = Window.Find(0,"Response")
Plugin mainHwnd = Window.Find(0,"Poster")
While (resHwnd > 0 and mainHwnd <> resHwnd)
VBS isWin = 0
Plugin isWin = Window.IsWindow(resHwnd)
If isWin > 0
Plugin Window.Active(resHwnd)
Delay 100
KeyDown 18,1
KeyPress 115,1
KeyUp 18,1
EndIf
Plugin resHwnd = Window.Find(0,"Response")
EndWhile
Return
//
Sub sendRequestData
MoveTo 56,278
LeftClick 1
Delay 100
KeyPress 9,1
Plugin Sys.SetCLB(filePath)
Delay 100
KeyDown 17,1
KeyPress 86,1
KeyUp 17,1
Delay 100
KeyDown 16,1
KeyPress 9,2
KeyUp 16,1
Delay 100
KeyPress 13,1
Delay 200
Return
//
Sub fishCatcher
MoveTo 862,392
LeftClick 1
Delay 500
LeftClick 3
Delay 100
KeyDown 17,1
KeyPress 67,1
KeyUp 17,1
Delay 100
Plugin text = Sys.GetCLB()
Delay 100
Gosub getMyFish
Return
//
Sub getMyFish
//Gosub fishLog
VBS tryList=Split(iWant,",")
VBS i=0
While i<=Ubound(tryList)

If Instr(text,tryList(i))
//nextTime = waitTime(requestTimes)
//Gosub waitNextRequest
//KeyPress 91,1
//KeyPress 123,1
VBS getMyFish = 1
EndIf
VBS i=i+1
EndWhile
Return
//
Sub waitNextRequest
While nextTime>0
VBS nextTime = nextTime - 1
Delay 1000
EndWhile
Return
//
Sub fishLog
Plugin fileLen=File.GetFileLength("c:\fishLog.txt")
Plugin file1=File.OpenFile("c:\fishLog.txt")
Plugin File.SeekFile(file1,fileLen)
Plugin File.WriteLine(file1,"["&now&"],"&requestTimes&","&text)
Plugin File.CloseFile(file1)
Return


相关文档
最新文档