SHoCK13666
Новичок
- Сообщения
- 108
- Репутация
- 0
Как сделать, чтобы при определённом условии (например при наличии какого-то текста на странице) скрипт возвращался к определённой строке и продолжал работу с этой строки??
MyFunc()
MsgBox(64, "Продолжение", "Вторая строка кода") ;2стр<=
MsgBox(0, "Продолжение", "Третья")
Func MyFunc()
While 1
Sleep(100)
If @YEAR = "2013" Then
MsgBox(48, "2013", "Ok =>")
Return ;попадем при выполнении условия на 2 стр=>
Else
MsgBox(16, "Error", "???? Выход")
Exit
EndIf
WEnd
EndFunc
_Goto(2) ; в скобках указываем номер строки от 1 до 3
Func _Goto($iStringNumber)
Select
Case $iStringNumber = 1
MsgBox(4096, "1", "Выполняем это (1 строка)")
Case $iStringNumber = 2
MsgBox(4096, "2", "Выполняем это (2 строка)")
Case $iStringNumber = 3
MsgBox(4096, "3", "Выполняем это (3 строка)")
Case Else
MsgBox(4096, "not found", "Не верный номер строки")
EndSelect
EndFunc
Global $aLink[1]
_IEErrorHandlerRegister('_ErrorIE')
$oIE = _IECreate('http://wm-zarabotok-na.ucoz.ru', 0, 0)
$oIE.TheaterMode = 1
$oLinks = _IELinkGetCollection($oIE)
If @error Then Exit @ScriptLineNumber
ReDim $aLink[@extended + 1][3]
For $oLink In $oLinks
If $oLink.classname == 'takru' Then
$aLink[0][0] += 1
$aLink[$aLink[0][0]][0] = $oLink
$aLink[$aLink[0][0]][1] = $oLink.innertext
$aLink[$aLink[0][0]][2] = $oLink.href
EndIf
Next
ReDim $aLink[$aLink[0][0] + 1][3]
;_ArrayDisplay($aLink)
If $aLink[0][0] < 3 Then Exit @ScriptLineNumber
$iRand = Random(2, $aLink[0][0], 1)
ConsoleWrite($aLink[$iRand][1] & @LF)
Sleep(Random(2000, 3000, 1))
$aLink[$iRand][0] .fireEvent('onmouseover')
Sleep(Random(500, 1000, 1))
$aLink[$iRand][0] .fireEvent('onmousedown')
$aLink[$iRand][0] .fireEvent('onmouseup')
$aLink[$iRand][0] .Click()
_IELoadWait($oIE)
$s_Text = _IEBodyReadText($oIE)
If @error Then Exit @ScriptLineNumber
If StringInStr($s_Text, 'заблокирован') Then
Sleep(Random(2000, 3000, 1))
_IELinkClickByText($oIE, 'Кликните Здесь')
If @error Then Exit @ScriptLineNumber
EndIf
Sleep(2000)
_IEQuit($oIE)
Sleep(10000)
ProcessClose("iexplore.exe")
If StringInStr($s_Text, 'заблокирован') Then
Sleep(Random(2000, 3000, 1))
_IELinkClickByText($oIE, 'Кликните Здесь')
Global $aLink[1]
Do
_IEErrorHandlerRegister('_ErrorIE')
$oIE = _IECreate('http://wm-zarabotok-na.ucoz.ru', 0, 0)
$oIE.TheaterMode = 1
$oLinks = _IELinkGetCollection($oIE)
If @error Then Exit @ScriptLineNumber
ReDim $aLink[@extended + 1][3]
For $oLink In $oLinks
If $oLink.classname == 'takru' Then
$aLink[0][0] += 1
$aLink[$aLink[0][0]][0] = $oLink
$aLink[$aLink[0][0]][1] = $oLink.innertext
$aLink[$aLink[0][0]][2] = $oLink.href
EndIf
Next
ReDim $aLink[$aLink[0][0] + 1][3]
;_ArrayDisplay($aLink)
If $aLink[0][0] < 3 Then Exit @ScriptLineNumber
$iRand = Random(2, $aLink[0][0], 1)
ConsoleWrite($aLink[$iRand][1] & @LF)
Sleep(Random(2000, 3000, 1))
$aLink[$iRand][0] .fireEvent('onmouseover')
Sleep(Random(500, 1000, 1))
$aLink[$iRand][0] .fireEvent('onmousedown')
$aLink[$iRand][0] .fireEvent('onmouseup')
$aLink[$iRand][0] .Click()
_IELoadWait($oIE)
$s_Text = _IEBodyReadText($oIE)
If @error Then Exit @ScriptLineNumber
If StringInStr($s_Text, 'заблокирован') Then
Sleep(Random(2000, 3000, 1))
_IELinkClickByText($oIE, 'Кликните Здесь')
If @error Then Exit @ScriptLineNumber
ContinueLoop ; Возврат к первой строчке
EndIf
Sleep(2000)
_IEQuit($oIE)
Sleep(10000)
ProcessClose("iexplore.exe")
ExitLoop
Until False
#include<Array.au3>
#include<IE.au3>
HotKeySet("{ESC}", "_Exit")
Local $sTmp = '', $sLink = ''
Local $oIE = _IECreate('http://wm-zarabotok-na.ucoz.ru')
Local $oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
If $oLink.href == 'http://www.tak.ru/' Then
$oDiv = $oLink.parentElement
For $oLink In $oDiv.childNodes
If $oLink.nodeType = 1 And $oLink.tagName = 'a' Then
If $oLink.href == 'http://www.tak.ru/' Then ContinueLoop
$sTmp &= $oLink.innerText & '|'
EndIf
Next
ExitLoop
EndIf
Next
Local $aLinks = StringSplit(StringTrimRight($sTmp, 1), '|')
;~ _ArrayDisplay($aLinks)
$sLink = _ClickRandomLink($oIE, $aLinks)
While 1
$oIE = _IEAttach('рекламный брокер')
$oText = _IETagNameGetCollection($oIE, 'center')
If StringInStr($oText(0).childNodes(0).innerText, 'заблокирован') Then
ConsoleWrite($sLink & ' --> Переход по рекламной ссылке был заблокирован!' & @CRLF)
_TabClose($oIE)
$oIE = _IEAttach('Заработок в интернете')
$sLink = _ClickRandomLink($oIE, $aLinks)
Else
ConsoleWrite('Ok! - > Exit' & @LF)
_IEQuit($oIE)
ExitLoop
EndIf
Sleep(1000)
WEnd
Exit
Func _ClickRandomLink($o_Obj, $a_Links)
Sleep(Random(2000, 3000, 1))
Local $s_Link = $a_Links[Random(1, $a_Links[0], 1)]
Local $o_Links = $o_Obj.document.links
For $o_Link In $o_Links
Local $s_LinkText = $o_Link.outerText & ""
If $s_LinkText = $s_Link Then
Sleep(Random(500, 1000, 1))
$o_Link.click()
ExitLoop
EndIf
Next
_IELoadWait($o_Obj, 2000)
Return $s_Link
EndFunc;==>_ClickRandomLink
Func _TabClose($o_Obj)
Local $o_Window = $o_Obj.document.parentWindow
$o_Window = $o_Window.open($o_Window.location.href, "_self");
$o_Window.close
Return 1
EndFunc;==>_TabClose
Func _Exit()
Exit
EndFunc;==>_Exit
;#include <Array.au3>
#include <IE.au3>
Global $aLink[1]
_IEErrorHandlerRegister('_ErrorIE')
$oIE = _IECreate('http://wm-zarabotok-na.ucoz.ru', 0, 0)
$oIE.TheaterMode = 1
$oLinks = _IELinkGetCollection($oIE)
If @error Then Exit @ScriptLineNumber
ReDim $aLink[@extended + 1][3]
For $oLink In $oLinks
If $oLink.classname == 'takru' Then
$aLink[0][0] += 1
$aLink[$aLink[0][0]][0] = $oLink
$aLink[$aLink[0][0]][1] = $oLink.innertext
$aLink[$aLink[0][0]][2] = $oLink.href
EndIf
Next
ReDim $aLink[$aLink[0][0] + 1][3]
;_ArrayDisplay($aLink)
If $aLink[0][0] < 3 Then Exit @ScriptLineNumber
$iRand = Random(2, $aLink[0][0], 1)
ConsoleWrite($aLink[$iRand][1] & @LF)
Sleep(Random(2000, 3000, 1))
$aLink[$iRand][0] .fireEvent('onmouseover')
Sleep(Random(500, 1000, 1))
$aLink[$iRand][0] .fireEvent('onmousedown')
$aLink[$iRand][0] .fireEvent('onmouseup')
$aLink[$iRand][0] .Click()
_IELoadWait($oIE)
$s_Text = _IEBodyReadText($oIE)
If @error Then Exit @ScriptLineNumber
If StringInStr($s_Text, 'заблокирован') Then
Sleep(Random(2000, 3000, 1))
_IELinkClickByText($oIE, 'Кликните Здесь')
If @error Then Exit @ScriptLineNumber
EndIf
Sleep(2000)
_IEQuit($oIE)
Sleep(10000)
ProcessClose("iexplore.exe")