提示窗口是第几行有问题?
把第6行“on error resume next” 移到第一行试试
其中第15行是用来调节阀值的 ...
9zhmke 发表于 2015-9-11 14:07
改成这样呢
Shell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName
pcl_test 发表于 2015-9-11 13:45 - kill4399 = "http://www.4399.com"
- killGame = "http://xp.4399.com/"
- set sh = CreateObject("Shell.Application")
- set wnds = sh.windows()
- Set Shell=CreateObject("Shell.Application")
- on error resume next
- while(true) 'By:原始程序林小七 2014.1.30,改版:9zhmke
- for each wnd in wnds
- if InStr(1, wnd.LocationURL, kill4399, 1) or InStr(1, wnd.LocationURL, killGame, 1) then
- for i=1 to 3
- Set objProc = GetObject("winmgmts:\\.\root\cimv2:win32_processor='cpu0'")
- if CPU_busy=Old_CPU_busy then wscript.sleep 300
- CPU_busy=objProc.LoadPercentage 'CPU使用率
- Old_CPU_busy=CPU_busy
- if CPU_busy >95 then wscript.quit'CPU使用率大于95%就退出
- Shell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName
- next
- end if
- next
- Wscript.Sleep 20000
- Wend
- on error goto 0
复制代码 XP系统。IE8浏览器。打开测试网页。运行vbs代码。测试了。。
虽然cpu占用一直很高。。但测试页面游戏,仍然可以正常玩。。
并没有实现:鼠标卡顿、系统卡顿、死机的效果。。 |