找回密码
 加入
搜索
查看: 1259|回复: 1

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

[复制链接]
发表于 2009-2-24 19:25:43 | 显示全部楼层 |阅读模式
将俩个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[0][0]>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
发表于 2009-2-24 20:13:05 | 显示全部楼层
没有效验过是否能运行,给个思路给你.

[au3]#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[0][0] > 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[/au3]
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-23 07:27 , Processed in 0.078288 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表