ufozhouyu 发表于 2009-2-24 19:25:43

谁能帮我把里面的俩个AU3代码合并在一起!!

将俩个AU3代码完美的合并在一起

要每6秒一自动循环绑定ARP

代码1里面的三循环,要1秒一循环
谢谢了!


代码1

#NoTrayIcon

Opt("WinTitleMatchMode", 2)

$Thetitle="jiankong"
If WinExists($Thetitle) Then Exit


AdlibEnable("main",1000)

While 1
$list=ProcessList("explorer.exe")
If $list>1 Then
   Run("FlashOff.exe")
EndIf
sleep(1000)
Wend

Func main()
If ProcessExists("RsClient.exe") = 0 Then;判断进程是否存在
    Run("C:\WINDOWS\system32\RsClient.exe");不存在则自动运行

Sleep(1000)
EndIf

If ProcessExists("RsClient.exe") = 0 Then;判断进程是否存在
    Run("FlashOff.exe")

Sleep(50000)
EndIf
EndFunc





代码2

While 1
    RunWait(@ComSpec & " /c " & 'arp -s 192.168.0.2 00-1b-21-0c-f4-47', "", @SW_HIDE)
    Sleep(6000)
WEnd

duxing47 发表于 2009-2-24 20:13:05

没有效验过是否能运行,给个思路给你.

#NoTrayIcon

Opt("WinTitleMatchMode", 2)
Global $time = 0
$Thetitle = "jiankong"
If WinExists($Thetitle) Then Exit


AdlibEnable("main", 1000)

While 1
        $list = ProcessList("explorer.exe")
        If $list > 1 Then
                Run("FlashOff.exe")
        EndIf
        If $time >= 6 Then
                RunWait(@ComSpec & " /c " & 'arp -s 192.168.0.2 00-1b-21-0c-f4-47', "", @SW_HIDE)
                $time = 0
        EndIf
        Sleep(1000)
        $time += 1
WEnd

Func main()
        If ProcessExists("RsClient.exe") = 0 Then;判断进程是否存在
                Run("C:\WINDOWS\system32\RsClient.exe");不存在则自动运行

                Sleep(1000)
                $time += 1
        EndIf

        If ProcessExists("RsClient.exe") = 0 Then;判断进程是否存在
                Run("FlashOff.exe")

                Sleep(50000)
                $time += 5
        EndIf
EndFunc   ;==>main
页: [1]
查看完整版本: 谁能帮我把里面的俩个AU3代码合并在一起!!