Тема закрыта.И зачем создавать 2 тему?
http://autoit-script.ru/index.php/topic,7897.msg53698.html#msg53698
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
$Form1 = GUICreate("Form1", 617, 438, 192, 114)
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 616, 400)
GUISetState(@SW_SHOW)
_IENavigate($Obj1, "http://dreamwar.ru/world/resource.php?end=1&UIN=897")
_IELoadWait($Obj1)
$sText = _IEBodyReadText ($Obj1)
$start = "Введите код:"
$end= "В Земли"
$source = StringFindSE($sText,$start,$end,1)
$w= StringLen($source)
$w=$w-1
$w = StringRight($source,$w)
ConsoleWrite($w)
_IEzap($Obj1,0,1,$w)
sleep(1000)
_IEclick($Obj1,0,5,"[Начать добычу]")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
func _IEclick($IESET,$form,$index,$name)
$oForm = _IEFormGetCollection($IESET, $form)
Do
$oSubmit = _IEFormElementGetCollection($oForm, $index)
Until StringStripWS(_IEFormElementGetValue($oSubmit), $index) = $name
_IEAction($oSubmit, "click")
EndFunc
func _IEzap($IESET,$form,$index,$text)
$oForm = _IEFormGetCollection($IESET,$form )
$oText = _IEFormElementGetCollection($oForm, $index)
_IEFormElementSetValue($oText,$text )
EndFunc
Func StringFindSE($string,$start="",$end="",$start_occ=1,$end_occ=1,$cas=0)
Local $source_start,$source_count,$source
If $start <> '' Then
Local $st_count
$st_count = StringSplit($start,'')
$source_start = StringInStr($string,$start,$cas,$start_occ) + $st_count[0]
Else
$source_start = 1
EndIf
If $end <> '' Then
$source_count = StringInStr($string,$end,$cas,$end_occ,$source_start) - $source_start
Else
$source_count = -1
EndIf
Return StringMid ($string,$source_start,$source_count)
EndFunc
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
$Form1 = GUICreate("Form1", 617, 438, 192, 114)
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 616, 400)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
_IENavigate($Obj1, "http://dreamwar.ru/world/resource.php?end=1&UIN=897367&pass=MDIxMjgz&sid=")
_IELoadWait($Obj1)
$sText = _IEBodyReadText ($Obj1)
$start = "Введите код:"
$end= "В Земли"
$source = StringFindSE($sText,$start,$end,1)
$w= StringLen($source)
$w=$w-1
$w = StringRight($source,$w)
ConsoleWrite($w)
_IEzap($Obj1,0,1,$w)
sleep(1000)
_IEclick($Obj1,0,5,"[Начать добычу]")
sleep(60000)
WEnd
func _IEclick($IESET,$form,$index,$name)
$oForm = _IEFormGetCollection($IESET, $form)
Do
$oSubmit = _IEFormElementGetCollection($oForm, $index)
Until StringStripWS(_IEFormElementGetValue($oSubmit), $index) = $name
_IEAction($oSubmit, "click")
EndFunc
func _IEzap($IESET,$form,$index,$text)
$oForm = _IEFormGetCollection($IESET,$form )
$oText = _IEFormElementGetCollection($oForm, $index)
_IEFormElementSetValue($oText,$text )
EndFunc
Func StringFindSE($string,$start="",$end="",$start_occ=1,$end_occ=1,$cas=0)
Local $source_start,$source_count,$source
If $start <> '' Then
Local $st_count
$st_count = StringSplit($start,'')
$source_start = StringInStr($string,$start,$cas,$start_occ) + $st_count[0]
Else
$source_start = 1
EndIf
If $end <> '' Then
$source_count = StringInStr($string,$end,$cas,$end_occ,$source_start) - $source_start
Else
$source_count = -1
EndIf
Return StringMid ($string,$source_start,$source_count)
EndFunc
#include <IE.au3>
GUICreate("Грезы войны", 500, 300)
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 500, 300)
GUISetState()
Do
_IENavigate($Obj1, 'ССЫЛКА')
$HTML = _IEBodyReadHTML($Obj1)
$CODE = StringRegExp($HTML, 'Введите код: (.*?)<', 3)
$INPUT = _IEGetObjByName($Obj1, 'code')
_IEFormElementSetValue($INPUT, $CODE[0])
$oInputs = _IETagnameGetCollection($Obj1, "input")
For $oInput in $oInputs
If String($oInput.Value) = "[Начать добычу]" Then
_IEAction($oInput, "click")
ExitLoop
EndIf
Next
Sleep(60000)
_IELinkClickByText($Obj1, '[Обновить]')
Until GUIGetMsg() = -3
Ну дак если он на уровне начальной школы, что мешает самому его сделать, мозгов не хватает даже для этого уровня? Если нужна помощь - нужно предоставлять всё что просят и в том виде в каком просят.beshen11 сказал(а):