#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
Opt("GUIOnEventMode", 0)
$GUI = GUICreate("Автологин", 351, 110, 190, 120)
$Avtologin = GUICtrlCreateLabel("Автологин для браузерной игры Мир теней", 8, 8, 340, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$label1 = GUICtrlCreateLabel("Логин:", 8, 32, 52, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$label2 = GUICtrlCreateLabel("Пароль:", 8, 56, 63, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$login = GUICtrlCreateInput("", 72, 32, 193, 21)
$pass = GUICtrlCreateInput("", 72, 56, 193, 21)
$Inp_Obnovl = GUICtrlCreateInput("", 144, 80, 105, 21, BitOR($ES_AUTOHSCROLL, $ES_NUMBER))
$Label4 = GUICtrlCreateLabel("(в секундах)", 256, 87, 91, 17)
$chb_obnov = GUICtrlCreateCheckbox("Обновление страниц", 8, 84, 129, 17)
$Vxod = GUICtrlCreateButton("Войти", 272, 40, 75, 25)
GUISetState()
While 1
Switch GUIGetMsg()
Case $Vxod
Vxod()
EndSwitch
Obnovlenie()
WEnd
Func Vxod()
$oIE = _IECreate("http://vten.ru/")
_IELinkClickByText($oIE, "Вход")
$oForms = _IEFormGetCollection($oIE, 0)
$oQuery = _IEFormElementGetCollection($oForms, 1) ;login
_IEFormElementSetValue($oQuery, GUICtrlRead($login))
$oQuery = _IEFormElementGetCollection($oForms, 2) ;pass
_IEFormElementSetValue($oQuery, GUICtrlRead($pass))
_IEFormSubmit($oForms)
EndFunc ;==>Vxod
Func Obnovlenie()
If GUICtrlRead($chb_obnov) = $GUI_CHECKED Then
Sleep(GUICtrlRead($Inp_Obnovl) * 1000)
ControlSend("[CLASS:IEFrame]", "", "", "{F5}")
EndIf
EndFunc ;==>Obnovlenie