一段按键精灵vbs脚本

' +++++++++++++++++脚本使用说明++++++++++++++++++++ '
' + 1、该脚本仅应用于通用播放器16分屏模式         + '
' + 2、主机屏幕分辨率必须预先设置成1440 * 900     + '
' + 3、前8分屏用于测试设备A,后8分屏用于测试设备B + '
' +++++++++++++++++++++++++++++++++++++++++++++++++ '


Private Const LongDelay  = 50 ' 50ms
Private Const ShortDelay = 1  ' 1ms


Sub MyDelay(n)
Delay n
End Sub


Sub Devide16Screen()
MoveTo 463, 178
RightClick 1
MoveTo 535, 195
MyDelay(LongDelay)
LeftClick 1
MoveTo 679, 347
LeftClick 1
End Sub


Function Num(n)
Num = "Num " & n
End Function


Sub PrintPort(Port)
Dim i


MoveTo 336, 128
LeftDown 1
MoveTo 290, 132
LeftUp 1
MyDelay(LongDelay)
KeyDown "Ctrl", 1
KeyDown "C", 1
MoveTo 427, 105
KeyUp "C", 1
MoveTo 477, 87
KeyUp "Ctrl", 1
MoveTo 627, 12


For i = 0 To UBound(Port)
KeyDown Num(Port(i)), 1
Next


End Sub


Sub PrintIp(Ip)
Dim i


MoveTo 210, 126
LeftDown 1
MoveTo 108, 126
LeftUp 1
MyDelay(LongDelay)
KeyDown "Ctrl", 1
KeyDown "C", 1
MoveTo 135, 126
KeyUp "C", 1
MoveTo 150, 126
KeyUp "Ctrl", 1
MoveTo 448, 116


For i = 0 To UBound(Ip)
KeyDown Num(Ip(i)), 1
    Next


End Sub


Sub SelectScreen(X, Y, Index)
MoveTo X(Index), Y(Index)
LeftClick 1
End Sub


Sub OpenDialog()
MoveTo 45, 34
LeftClick 1
MoveTo 50, 90
MyDelay(LongDelay)
LeftClick 1
MoveTo 73, 125
LeftClick 1
MoveTo 64, 143
MyDelay(LongDelay)
LeftClick 1
End Sub


Sub CloseDialog()
MoveTo 278, 240
LeftClick 1
MoveTo 331, 145
LeftClick 1
End Sub


Sub IpConfig()
Dim i, X, Y, Port, Ip, ScrNum


X = Array(200, 550, 850, 1220, 200, 550, 850, 1220, 200, 550, 850, 1220, 200, 550, 850, 1220)
Y = Array(100, 100, 100, 100,  300, 300, 300, 300, 500, 500, 500, 500, 700, 700, 700, 700)
Port = Array(1, 0, 0, 1, 1)
Ip   = Array(1, 9, 2, ".", 1, 6, 8, ".", 0, ".", 5, 0)


Call Devide16Screen()


ScrNum = UBound(X) + 1
For i = 1 To ScrNum


If i = 9 Then
Port(3) = Port(3) + 1
End If


If Port(4) = 9 Then
Port(4) = 1
End If


Call SelectScreen(X, Y, (i - 1))
Call OpenDialog()


If i = 1 Then
Call PrintIp(Ip)
End If


Call PrintPort(Port)
Port(4) = Port(4) + 1
Call CloseDialog()


    Next
    MsgBox "执行完毕!"
End Sub


Call IpConfig()

展开阅读全文

没有更多推荐了,返回首页