|
Set check_input=New RegExp
check_input.Pattern="^((\d{1,2}-\d{1,2},)|(\d{1,2},))*((\d{1,2}-\d{1,2})|(\d{1,2}))$"
Do
input=InputBox("请输入回归关卡的编号或范围。例如,1,3,5-12","推箱子自动回归")
If input = "" Then WScript.quit
If check_input.Test(input) Then Exit do
MsgBox "输入的关卡编号或者范围格式不正确,请重新输入",48,"提示"
loop
Dim level(99)
levels=Split(input,",")
count=Len(input)-Len(Replace(input,",",""))
For i=0 To count
If InStr(levels(i),"-")=0 Then
level(CInt(levels(i)))=True
Else
Range=Split(levels(i),"-")
Range(0)=CInt(Range(0))
Range(1)=CInt(Range(1))
If Range(0)>Range(1) Then
num_ls=Range(0)
Range(0)=Range(1)
Range(1)=num_ls
End If
For j=Range(0) To Range(1)
level(j)=True
Next
End If
Next
For i=0 To 99
If level(i)=True Then
level_select=i
RunAction "Selectlevel", oneIteration,level_select
RunAction "level"&i, oneIteration
End If
Next
MsgBox "所选 " & input & vbcrlf & "范围全部回归结束"
RunAction "Close_Box", oneIteration
exitrun |
|