#include <IE.au3>
$iError = 1
$sLogin = 'Login'
$sPass = 'Pass'
$oIE = _IECreate('http://www.cwars.ru/')
If @error Then
MsgBox(16, 'Error', '_IECreate')
Exit
EndIf
For $i = 1 To 1
$oForm = _IEGetObjByName($oIE, 'log')
If @error Then ExitLoop
$oLogin = _IEFormElementGetObjByName($oForm, 'nick')
If @error Then ExitLoop
$oPass = _IEFormElementGetObjByName($oForm, 'password')
If @error Then ExitLoop
_IEFormElementSetValue($oLogin, $sLogin)
If @error Then ExitLoop
_IEFormElementSetValue($oPass, $sPass)
If @error Then ExitLoop
_IEFormSubmit($oForm)
If @error Then ExitLoop
$iError = 0
Next
If $iError Then
MsgBox(16, 'Error', 'Error')
_IEQuit($oIE)
Exit
Else
MsgBox(64, 'Info', 'OK')
EndIf