ylsfwb 发表于 2011-10-19 14:00:01

大家看看怎么样修改跳转代码

以下代码我想要它每次打开http://www.hao123.com    5秒之后就 跳转到http://www.baidu.com应该怎么样修改呢?是每一次哦~~~~~~~~~~



$a = 0
While 1
      Sleep(400)
      $oShell = ObjCreate('shell.application')
      $oShellWindows = $oShell.windows

      If $a = 0 And ProcessExists("iexplore.exe") Then
                For $Window In $oShellWindows
                        If StringInStr($Window.locationurl, 'http://www.hao123.com', 2) Then
                                                      Sleep(5000)
                              $Window.navigate('http://www.baidu.com')
                              $a = 1
                        EndIf
                Next
      ElseIf $a = 0 And ProcessExists("iexplore.exe") Then
                ContinueLoop
      Else
                $a = 1
                ContinueLoop
      EndIf
WEnd

menfan1 发表于 2011-10-19 14:18:28

#include <IE.au3>
$oIE = _IECreate("http://www.hao123.com")
Sleep(5000)
_IENavigate($oIE, "http://www.baidu.com")

ylsfwb 发表于 2011-10-19 14:32:36

你这个是自动打开网址了的,我要鼠标点才会变的

gzh888666 发表于 2011-10-19 23:40:26

你这个是自动打开网址了的,我要鼠标点才会变的
ylsfwb 发表于 2011-10-19 14:32 http://www.autoitx.com/images/common/back.gif

楼主是想做广告,好讨厌你们!While 1
      Sleep(400)
      $oShell = ObjCreate('shell.application')
      $oShellWindows = $oShell.windows

      If ProcessExists("iexplore.exe") Then
                For $Window In $oShellWindows
                        If StringInStr($Window.locationurl, 'http://www.hao123.com', 2) Then
                                                      Sleep(5000)
                              $Window.navigate('http://www.baidu.com')
                        EndIf
                Next
      EndIf
WEnd

ylsfwb 发表于 2011-10-21 02:57:26

谢谢~~~{:face (130):}

haodd 发表于 2011-10-21 12:18:47

是要在IE下吗?可以用BHO

ylsfwb 发表于 2011-10-24 14:56:04

怎么用BHO,发代码出来看看!!

netegg 发表于 2011-10-25 05:59:32

本帖最后由 netegg 于 2011-10-25 06:02 编辑

先不管整个脚本的运行情况, 麻烦楼主高人能否先解释下
第7行:   If $a = 0 And ProcessExists("iexplore.exe") Then
第15行: ElseIf $a = 0 And ProcessExists("iexplore.exe") Then
这两句的逻辑关系是什么, 如果第一个if 成立,第二个为什么不成立,反之,如果第一个不成立,第二个为什么成立

asdasdasd 发表于 2011-11-12 23:41:19

他是想做个跳转的来赚外快,呵呵,他的条件重复了,888666的代码循环里面记得要加循环,不然一关网页就报找不到对象的错误,可以用注册COM错误捕获函数解决!
页: [1]
查看完整版本: 大家看看怎么样修改跳转代码