Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 03:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HILFE] Fehler im Script

Discussion on [HILFE] Fehler im Script within the AutoIt forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2012
Posts: 63
Received Thanks: 20
[HILFE] Fehler im Script

hallo, Leute!
Ich habe einen Fehler in meinem Script, weiss aber nicht was er damit meint :

Mein Code:
Code:
#include <IE.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Local $oIE = _IECreate("www.darkorbit.com")
Sleep(3000)
MsgBox(0, "Login", "Bitte Einloggen! Please login!")
$Url = 'http://www.darkorbit.com/'
$User = MsgBox (524288, "Username", "Bitte Username eingeben:")
$Pwd = MsgBox (524288, "Passwort", "Bitte Passwort eingeben:")
$test = _IEAutoLogin($Url, $User, $Pwd)

Func _IEAutoLogin($sUrl, $sUsername, $sPwd)
 ;funkey 09.09.09
 $oIE = _IECreate($sUrl)
 _IEErrorNotify(False)
 _IEErrorHandlerRegister()
 $oForms = _IEFormGetCollection($oIE)
 If @error Then
  Return SetError(1, _IEErrorHandlerDeRegister(), $oIE) ;'no forms --> no login'
 Else
  $Index = 0
  For $oForm In $oForms
   $oFormElements = _IEFormElementGetCollection($oForm)
   If IsObj($oFormElements) Then
    $IndexElement = 0
    For $oElement In $oFormElements
     If $oElement.Type = 'password' Then
      $oPwd = _IEFormElementGetObjByName($oForm, $oElement.Name)
      _IEFormElementSetValue($oPwd, $sPwd)
      For $i = $IndexElement - 1 To 0 Step -1
       $oUser = _IEFormElementGetCollection($oForm, $i)
       If $oUser.Type = 'text' Then
        _IEFormElementSetValue($oUser, $sUsername)
        ExitLoop
       EndIf
      Next
      If $oForm.action <> "0" And Not StringInStr($oForm.action, '.php') Then  ;submit
       _IEFormSubmit($oForm, 0)
       _IELoadWait($oIE)
      Else  ;click
       For $i = $IndexElement + 1 To $IndexElement + 10 ;check the next 10 elements
        $oButton = _IEFormElementGetCollection($oForm, $i)
        If $oButton.Type = 'submit' Then
         _IEAction($oButton, "click")
         ExitLoop
        EndIf
       Next
      EndIf   $index += 1
  Next
 EndIf
 Return SetError(2, _IEErrorHandlerDeRegister(), $oIE) ;no password-field found
EndFunc   ;==>_IEAutoLogin
Die Fehlermeldung ist:
Illegal text at the end of statement (one statement per line).
Der Fehler ist in Zeile 52 bei dem $index += 1!
Bitte Hilfe!

DarkPlayer123

GELÖST!
Der richtige Code ist :
Code:
#include <IE.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Local $oIE = _IECreate("www.darkorbit.com")
Sleep(3000)
MsgBox(0, "Login", "Bitte Einloggen! Please login!")
$Url = 'http://www.darkorbit.com/'
$User = MsgBox (524288, "Username", "Bitte Username eingeben:")
$Pwd = MsgBox (524288, "Passwort", "Bitte Passwort eingeben:")
$test = _IEAutoLogin($Url, $User, $Pwd)

Func _IEAutoLogin($sUrl, $sUsername, $sPwd)
 ;funkey 09.09.09
 $oIE = _IECreate($sUrl)
 _IEErrorNotify(False)
 _IEErrorHandlerRegister()
 $oForms = _IEFormGetCollection($oIE)
 If @error Then
  Return SetError(1, _IEErrorHandlerDeRegister(), $oIE) ;'no forms --> no login'
 Else
  $Index = 0
  For $oForm In $oForms
   $oFormElements = _IEFormElementGetCollection($oForm)
   If IsObj($oFormElements) Then
    $IndexElement = 0
    For $oElement In $oFormElements
     If $oElement.Type = 'password' Then
      $oPwd = _IEFormElementGetObjByName($oForm, $oElement.Name)
      _IEFormElementSetValue($oPwd, $sPwd)
      For $i = $IndexElement - 1 To 0 Step -1
       $oUser = _IEFormElementGetCollection($oForm, $i)
       If $oUser.Type = 'text' Then
        _IEFormElementSetValue($oUser, $sUsername)
        ExitLoop
       EndIf
      Next
      If $oForm.action <> "0" And Not StringInStr($oForm.action, '.php') Then  ;submit
       _IEFormSubmit($oForm, 0)
       _IELoadWait($oIE)
Else  ;click
       For $i = $IndexElement + 1 To $IndexElement + 10 ;check the next 10 elements
        $oButton = _IEFormElementGetCollection($oForm, $i)
        If $oButton.Type = 'submit' Then
         _IEAction($oButton, "click")
         ExitLoop
        EndIf
       Next
      EndIf
      Return SetExtended(_IEErrorHandlerDeRegister(), $oIE)
     EndIf
     $IndexElement += 1
    Next
   EndIf
   $Index += 1
  Next
 EndIf
 Return SetError(2, _IEErrorHandlerDeRegister(), $oIE) ;no password-field found
EndFunc   ;==>_IEAutoLogin
iU0U2bm9E1Gir7gf is offline  
Old 07/10/2012, 10:45   #2


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685

#closed
Lawliet is offline  
Closed Thread


Similar Threads Similar Threads
hilfe beim samp script fehler
04/27/2012 - Grand Theft Auto - 4 Replies
Smoke Reallife Run Time Error Problem Hey Leute, ich habe das Smoke Reallife script nur ich habe problem :D Undzwar: Ich habe das script eingefügt und habe den server gestartet und es hat alles gefunkt. Und dann habe ich mal aus lw Compile und keine errors nur paar warnings! Dann habe ich diesen Error wenn ich den server starte:
[Hilfe]Fehler in Script beheben.
11/12/2011 - Metin2 Private Server - 2 Replies
Hey Leute, kann einer von euch das Script so ändern, dass diese Dumme Meldung nicht mehr kommt? Screen:http://img580.imageshack.us/img580/9797/un benannt1eqf.jpg Script: <div id="content"> <div class="postui2 text-title"> <h2> Registration
blue bird leecher script fehler.. HILFE
05/09/2010 - Diablo 2 - 4 Replies
es commt die fehler meldung bla bla ... libs/common/ntattack.ntl / use redemtion..117 wie lässt sich das beheben er hört nach der meldung auf zu kämpfen tränke sind im gurt sda wo sie hingehören..



All times are GMT +1. The time now is 03:42.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.