BobSherman

IE.au3 Error When Submitting Simple Form

3 posts in this topic

I am attempting to enter the logon ID and password into the form below and submit it.

But, I am experiencing an error in IE.au3 whether I use _IEAction to submit a click (which does submit the form) or _IEFormSubmit (which does not submit the form before it errors out).

The form seems rather simple:

<form method="post" action="logon_submit.php">
                       <input type="hidden" name="visit" value="sRhvMItOu1hNV_y9t4iB7xhns2UJ0pUIYmpJyy3CivjvGYv0ST1QHY40QP9H5UPTqonadminkin_65dvtXxSIXDPwyFFI6WPVQFmgFtba8vW3OH">
<table width="100%" border="0" cellpadding="0" align="center" cellspacing="0">
                    <tr>
                      <td valign=top><table width="100%" border="0" cellpadding="4" cellspacing="1">
                          <tr>
                            <td align="Right"><b>Username: <span class="style1">*</span></b></td>
                            <td width="80%"><input type="TEXT" name="user" style="width: 90%;">
                            </td>
                          </tr>
                          <tr>
                            <td align="Right"><b>Password: <span class="style1">*</span></b></td>
                            <td><input type="password" name="pass" style="width: 90%;">
                            </td>
                          </tr>
                          <tr>
                            <td align="Right">&nbsp;</td>
                            <td><input type="submit" name="Submit" value="Submit Form">
                            </td>
                          </tr>
                          <tr>
                            <td align="Right">&nbsp;</td>
                            <td><a href="resetpw.php?visit=sRhvMItOu1hNV_y9t4iB7xhns2UJ0pUIYmpJyy3CivjvGYv0ST1QHY40QP9H5UPTqonadminkin_65dvtXxSIXDPwyFFI6WPVQFmgFtba8vW3OH" class=white>Forgot your password ?</a></td>
                          </tr>
                        </table>
                          <p>&nbsp;</p>
                      </td>
                    </tr>
                  </table>
                </form>

 

My function to perform the logon is:

 

Func StartUp()
   _IELinkClickByText ( $oIE, "Log On" )
   Sleep(2000)
   Local $oForm = _IEFormGetCollection($oIE)
   Local $iNumberOfForms = @extended

   For $iForm = 0 To $iNumberOfForms - 1
     $oForm = _IEFormGetCollection($oIE, $iForm)

     Local $oQuery = _IEFormElementGetCollection($oForm)

     Local $iNumberOfFormElements = @extended

     For $iElement = 0 to $iNumberOfFormElements - 1
         Local $oFormElement = _IEFormElementGetCollection($oForm, $iElement )
         If $oFormElement.name = 'user' Then
            _IEFormElementSetValue ( $oformElement, "xxxxx", 0)
         elseif $oFormElement.name = "pass" Then
            _IEFormElementSetValue ( $oFormElement, "yyyyy", 0)
            ; Sleep for 2 seconds.
            Sleep(2000)
            Local $oSubmit = _IEGetObjByName($oIE, "Submit")
            _IEAction($oSubmit, "click")
            Sleep(3000)
         EndIf
      Next
   Next
EndFunc

 


After the submission of the form completes and goes to the next page I'm getting the following error as a popup from AutoIt:

 


Line 970 (File "D\Program Files (x86)\AutoIt3\Include\IE.au3"):
Case $iIndex > -1 And $iIndex < $oObject.elements.length
Case $iIndex > -1 And $iIndex < $oObject^ ERROR
Error: The requested actions with this object has failed.


It's hard to imagine that such a simple form is causing so many problems.

Any help would be appreciated.

 

 

 

Share this post


Link to post
Share on other sites



That line number is located inside the function _IEFormElementGetCollection. Your code calls this function multiple times. Have you determined which call is generating the error?

I suspect it's the initial one, but can't tell from your post. Suggest that you add some error checking for each call to the IE functions.

Share this post


Link to post
Share on other sites

Thanks Danp2.

It was simply a dumb mistake.

I found that i submitted the form after filling in the 3'rd input element. This moved on to the next page.

But, the loop continued to examine the 4'th element which no longer existed.This caused the error.

So, I added an "Exitloop 2" statement after the final sleep which worked to get out of the two For loops.

Thanks again.

Share this post


Link to post
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

  • Similar Content

    • ChipConnJohn
      By ChipConnJohn
      Hello all,
      I'm trying to create a webscrape script using AutoIt.  A non-profit I'm involved with is using GroupSpaces.com and there is no notification to the group when someone posts a new topic to the forum.  I'm including IE.au3

      #include <MsgBoxConstants.au3>
      #include <Array.au3>
      #include <String.au3>
      ; Open Groupspaces.com
      Global $oIE = _IECreate ("http://www.groupspaces.com")
      _IENavigate($oIE,"http://groupspaces.com/MyCrazyTest/forum/")
      ;Grab all the links on the Forum page
      Global $oLinksCategoryPage = _IELinkGetCollection($oIE)
      For $oLink In $oLinksCategoryPage
          Local $oLinkHRef = $oLink.href
          If StringInStr($oLinkHRef,"forum_id") Then
              ;This is a category. Click into it.
              _IENavigate($oIE,$oLinkHRef)
      Sleep(3)
              ;Back out to Category List
              _IEAction($oIE,"back")
          EndIf
      Next
      _IEQuit($oIE)
    • kevin42036
      By kevin42036
      Hi All,

      I am very new to AutoIt and scripting in general and have a question about IEFormGetObjByName. The help function says:
      _IEFormGetObjByName ( ByRef $oObject, $sName [, $iIndex = 0] )
      But how do I find what to enter for $sName? In the example below, it says that it can be found by viewing the HTML source. So I went to the google home page, clicked Ctrl U to view the source, and cant figure out how they determined that the $sName is 'gbqf'. Can someone explain this process to me? Thanks in advance!
      ; Get a reference to a specific form by name.  In this case, submit a query
      ; to the Google search engine.  Note that the names of the form and form
      ; elements can be found by viewing the page HTML source
      #include <IE.au3>
      Local $oIE = _IECreate("http://www.google.com")
      Local $oForm = _IEFormGetObjByName($oIE, "gbqf")
      Local $oQuery = _IEFormElementGetObjByName($oForm, "q")
      _IEFormElementSetValue($oQuery, "AutoIt IE.au3")
      _IEFormSubmit($oForm)
       
    • knuxfighter
      By knuxfighter
      Hello. I've been working with Imagesearch library lately and it did a good work, although I moved to a new PC and didn't copy the old files with me so I downloaded the Imagesearch from the following post
       hoping that it will work. It doesn't though. First time I when I use (run as subscript to my code) the Imagesearch.au3, Scite finds errors (missing spaces). Ctrl+T (scite tidy) fixes these missing spaces but the script returns the following error on every run after:
      _ImageSearch('search.bmp', 0, $x, $y, 0) outputs
       
      "C:\Users\Knuckles\Desktop\AutoIt\include\ImageSearch.au3" (44) : ==> Subscript used on non-accessible variable.: If $result[0] = "0" Then Return 0 If $result^ ERROR no matter if I put the searched bmp in the script folder or folder img in the script directory. Also, it doesn't matter if the searched image on screen or not, it returns the same.

      Can you provide me any help please? I remember having these problems 2 years ago when I first met the imagesearch library also (I fixed it somehow though in that time). Seems nothing changed.

      Using this version posted in the following post gives the same error:
      Also I run windows 10 64bit and I have no shell options for script editing, running as x86 or whatever as I used to have on windows xp/7. I went through some steps like deleting a key in registry and I even reinstalled autoit and scite but that only resulted to au3 as unrecognized file format and not in getting back the menus and the icon on au3 files. Any thoughts on this?

      Edit: Installing 64-bit AutoIt and using 64bit ImageSearch is no change.
      code.au3

      FOUND WORKING: http://www.codebot.de/index.php/Thread/12713-Imagesearch-au3-funktioniert-nicht/
       but why is this one working and the original aren't? :(
    • BJJ
      By BJJ
      Hello everyone,
      I have huge problem with "Recurison level has been exceeded - AutoIt will quit to prevent stack overflow" in my own Bot.
      I have no idea how rebuild my loops for eliminate this type of error.
       
      Here is my code 
       
      #Region #AutoIt3Wrapper_Icon=C:\Users\barbosa\Desktop\autoIt\produkcja\angelica.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Run_Obfuscator=y #EndRegion #Region ; GUI generated by GUIBuilderNxt Prototype 1.0 #include <Constants.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> ;#include <nomad.au3> HotKeySet("{end}","stop") ;end for app kill Local Const $sFont = "Open Sans" ;font variable Local $sFile = "angelica.ico" ;icon variable Global $MainStyle = BitOR($WS_OVERLAPPED, $WS_CAPTION, $WS_SYSMENU, $WS_VISIBLE, $WS_CLIPSIBLINGS, $WS_MINIMIZEBOX, $FW_SEMIBOLD = 600) Global $info_task = "[ Waiting for calibration ]",$info_battlelist = "None",$info_empty = "None",$info_hotkeys = "INACTIVE",$info_100 = "None",$info_mana = "None",$info_food = "None",$info_blank = "None",$info_drop = "None",$info_hand = "None" Global $hMain = GuiCreate("Auto_Angela_Beta_1.0", 330, 559, -1, -1, $MainStyle) GUISetIcon($sFile) $label_100 = GuiCtrlCreateLabel("[F4] Mana Point "&" "&$info_100, 20, 40, 170, 20,-1) $label_mana = GuiCtrlCreateLabel("[F5] Mana Bar "&" "&$info_mana, 20, 60, 170, 20,-1) $label_empty = GuiCtrlCreateLabel("[F6] Nothing "&" "&$info_empty, 20, 80, 170, 20,-1) $label_battlelist = GuiCtrlCreateLabel("[F7] Battle List "&" "&$info_battlelist, 20, 100, 170, 20,-1) $label_food = GuiCtrlCreateLabel("[F8] Food "&" "&$info_food, 20, 120, 170, 20,-1) $label_blank = GuiCtrlCreateLabel("[F9] Blank "&" "&$info_blank, 20, 140, 170, 20,-1) $label_drop = GuiCtrlCreateLabel("[F10] Drop "&" "&$info_drop, 20, 160, 170, 20,-1) $label_hand = GuiCtrlCreateLabel("[F11] Hand "&" "&$info_hand, 20, 180, 170, 20,-1) $Group_11 = GuiCtrlCreateGroup("Configuration", 10, 10, 190, 220,-1) $Group_12 = GuiCtrlCreateGroup("Setup", 210, 10, 110, 220,-1) $btn_setting = GuiCtrlCreateButton("Setup", 220, 40, 70, 30,-1) $btn_load = GuiCtrlCreateButton("Load", 220, 100, 70, 30,-1) $btn_save = GuiCtrlCreateButton("Save", 220, 140, 70, 30,-1) $label_hotkeys = GuiCtrlCreateLabel("Status: "&$info_hotkeys, 220, 190, 90, 20,-1) $input_spell = GuiCtrlCreateInput("Adura Vita", 20, 270, 120, 20,-1) $box_house_mode = GuiCtrlCreateCheckbox("House mode", 20, 300, 90, 20,-1) $box_pk_mode = GuiCtrlCreateCheckbox("Anty PK", 20, 330, 90, 20,-1) $Checkbox_20 = GuiCtrlCreateCheckbox("Alarms", 20, 360, 90, 20,-1) $Checkbox_21 = GuiCtrlCreateCheckbox("Anty Idle", 20, 390, 90, 20,-1) $btn_auto = GuiCtrlCreateButton("Start", 200, 360, 70, 30,-1) $btn_refiler = GuiCtrlCreateButton("Rune thrower", 200, 400, 70, 20,-1);$btn_manual = GuiCtrlCreateButton("Start", 200, 360, 70, 30,-1) $Input_22 = GuiCtrlCreateInput("down", 140, 300, 60, 20,-1) $Input_23 = GuiCtrlCreateInput("up", 210, 300, 60, 20,-1) $Group_24 = GuiCtrlCreateGroup("Mode", 10, 250, 310, 180,-1) GUISetFont(9, $FW_SEMIBOLD) ;white color and bigger font ;$label_task = GuiCtrlCreateLabel($info_task, 10, 450, 370, 24,-1) GUICtrlSetColor($label_task, 0xffffff) GUISetFont(9, $FW_MEDIUM) $Label_28 = GuiCtrlCreateLabel("Auto_Angela_Beta 1.1 @ Medivia 2016", 60, 530, 370, 20,-1) Global $way_one Global $way_one Global $food_pos_x,$food_pos_y Global $hand_pos_x,$hand_pos_y Global $drop_pos_x,$drop_pos_y Global $blank_pos_x, $blank_pos_y Global $RunOrNot Global $pid Global $hotkeys = 0 ;By default hotkeys are disabled Global $mana_color, $battle_color Global $mana_100_x,$mana_100_y Global $mana_pixel_x, $mana_pixel_y Global $empty_pixel_x = 000, $empty_pixel_y = 000 Global $battle_pixel_x, $battle_pixel_y Global $is_break ;Global $MapClickEscape_x, $MapClickEscape_y ;GUICtrlSetDefColor(0xFF0000) GUISetBkColor(0x788190) ; will change background color ;GUICtrlSetBkColor($label_hand, 0xF0F4F9) GuiSetState(@SW_SHOWNORMAL) Do Switch GuiGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_setting _EnableDisable() ;function which make hotkeys enable/disable Case $btn_auto IF $info_food <> "None" OR $info_blank <> "None" OR $info_drop <> "None" OR $info_hand <> "None" OR $info_100 <> "None" OR $info_mana <> "None" Then ;simple validation data in possitions variables check_mana() ;Function is first in chain for making runes Else MsgBox(0, "Error", "You must setup coordinations") EndIf Case $btn_load load_from_file() ;load data from text file Case $btn_save save_to_file() ;dave data in text file Case $btn_refiler refiler() ;for fast refile EndSwitch Until False #EndRegion ;Func uher() ;x,y postaci = F10 DROP ;x,y uha w plecaku = F9 Blank ;kolor uha pobrany przy ustawieniu ;kolor plecaka = F6 BP Color ;odpowienio przygotowane staki plecakow ;co 400ms sprawdza czy jest dosc hp na uha ;jesli trzeba sie uchnac to sprawdza czy w miejscu na uha jest niebieska runa ;jesli nie ma to sprawdza czy jest yellow bp jesli nie ma to sygnal dzwiekowy bledu i kill uhera ;jesli jest to otwiera plecak i sprawdza czy jest niebieska runa jak nie ma to error i kill uhera ;jesli jest to ja przeciaga na postac bardzo szybko ;EndFunc Func refiler() local $i = 20 While $i > 0 MouseClickDrag($MOUSE_CLICK_LEFT, $blank_pos_x, $blank_pos_y, $drop_pos_x, $drop_pos_y, 1) $i = $i - 1 WEnd EndFunc Func save_to_file() $file = FileOpen("angela_memory.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to save data.") Else FileWrite($file, $mana_100_x & @CRLF) FileWrite($file, $mana_100_y & @CRLF) FileWrite($file, $mana_pixel_x & @CRLF) FileWrite($file, $mana_pixel_y & @CRLF) FileWrite($file, $empty_pixel_x & @CRLF) FileWrite($file, $empty_pixel_y & @CRLF) FileWrite($file, $battle_pixel_x & @CRLF) FileWrite($file, $battle_pixel_y & @CRLF) FileWrite($file, $food_pos_x & @CRLF) FileWrite($file, $food_pos_y & @CRLF) FileWrite($file, $blank_pos_x & @CRLF) FileWrite($file, $blank_pos_y & @CRLF) FileWrite($file, $drop_pos_x & @CRLF) FileWrite($file, $drop_pos_y & @CRLF) FileWrite($file, $hand_pos_x & @CRLF) FileWrite($file, $hand_pos_y & @CRLF) MsgBox(0, "Done", "Settings saved.") EndIf EndFunc Func load_from_file() $file = FileOpen("angela_memory.txt", $FO_READ) If $file = -1 Then MsgBox(0, "Error", "Unable to load data.") Else ;wczytywanie segmentow $mana_100_x = FileReadLine($file, 1) $mana_100_y = FileReadLine($file, 2) $info_100 = "X: "&$mana_100_x&" "&"Y: "&$mana_100_y GUICtrlSetData($label_100, "[F4] Mana point "&" "&$info_100) ;;;; $mana_pixel_x = FileReadLine($file, 3) $mana_pixel_y = FileReadLine($file, 4) $info_mana = "X: "&$mana_pixel_x&" "&"Y: "&$mana_pixel_y GUICtrlSetData($label_mana, "[F5] Mana Bar "&" "&$info_mana) ;;;; $empty_pixel_x = FileReadLine($file, 5) $empty_pixel_y = FileReadLine($file, 6) $info_empty = "X: "&$empty_pixel_x&" "&"Y: "&$empty_pixel_y GUICtrlSetData($label_empty, "[F6] Nothing "&" "&$info_empty) ;;;; $battle_pixel_x = FileReadLine($file, 7) $battle_pixel_y = FileReadLine($file, 8) $info_battlelist = "X: "&$battle_pixel_x&" "&"Y: "&$battle_pixel_y GUICtrlSetData($label_battlelist, "[F7] Battle List "&" "&$info_battlelist) ;;;; $food_pos_x = FileReadLine($file, 9) $food_pos_y = FileReadLine($file, 10) $info_food = "X: "&$food_pos_x&" "&"Y: "&$food_pos_y GUICtrlSetData($label_food, "[F8] Food "&" "&$info_food) ;;;; $blank_pos_x = FileReadLine($file, 11) $blank_pos_y = FileReadLine($file, 12) $info_blank = "X: "&$blank_pos_x&" "&"Y: "&$blank_pos_y GUICtrlSetData($label_blank, "[F9] Blank "&" "&$info_blank) ;;;; $drop_pos_x = FileReadLine($file, 13) $drop_pos_y = FileReadLine($file, 14) $info_drop = "X: "&$drop_pos_x&" "&"Y: "&$drop_pos_y GUICtrlSetData($label_drop, "[F10] Drop "&" "&$info_drop) ;;;; $hand_pos_x = FileReadLine($file, 15) $hand_pos_y = FileReadLine($file, 16) $info_hand = "X: "&$hand_pos_x&" "&"Y: "&$hand_pos_y GUICtrlSetData($label_hand, "[F11] Hand "&" "&$info_hand) ;;;; FileClose($file) MsgBox(0, "Done", "Settings loaded") EndIf EndFunc Func stop() Exit EndFunc Func kill() Exit 0 EndFunc ;functions checking if checkbox checked Func _IsChecked_pk_mode($box_pk_mode) Return BitAND(GUICtrlRead($box_pk_mode), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func _IsChecked_house_mode($box_house_mode) Return BitAND(GUICtrlRead($box_house_mode), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func floor_maker() ;GUICtrlSetData($label_task, "[ Burning rune.. ]") $spell_name = GUICtrlRead($input_spell) $way_one = GUICtrlRead($Input_22) $way_two = GUICtrlRead($Input_23) If _IsChecked_house_mode($box_house_mode) Then ControlSend("Medivia","","", "{" & $way_one & "}" ) EndIf Sleep(1000) MouseClickDrag($MOUSE_CLICK_LEFT, $blank_pos_x, $blank_pos_y, $hand_pos_x, $hand_pos_y, 2) ControlSend("Medivia","","",$spell_name) ControlSend("Medivia","","","{enter}") MouseClickDrag($MOUSE_CLICK_LEFT, $hand_pos_x, $hand_pos_y, $drop_pos_x, $drop_pos_y, 2) Sleep(300) MouseClick($MOUSE_CLICK_RIGHT, $food_pos_x, $food_pos_y, 4, 10) Sleep(400) MouseClick($MOUSE_CLICK_RIGHT, $food_pos_x, $food_pos_y, 4, 10) Sleep(300) If _IsChecked_house_mode($box_house_mode) Then ControlSend("Medivia","","", "{" & $way_two & "}" ) EndIf Beep(1000, 150) check_mana() EndFunc Func _EnableDisable() If $hotkeys = 0 Then HotKeySet("{F4}", "mana_100") HotKeySet("{F5}", "mana_get_color") ;HotKeySet("{F6}", "MapClickEscape") HotKeySet("{F7}", "battle_get_color");Pobiera kolor do zmiennej $battle_color HotKeySet("{F8}", "mouse_pos_food") HotKeySet("{F9}", "mouse_pos_blank") HotKeySet("{F10}", "mouse_pos_drop") HotKeySet("{F11}", "mouse_pos_hand") $hotkeys = 1 $info_hotkeys = "ACTIVE" GUICtrlSetData($label_hotkeys, "Status: "&" "&$info_hotkeys) GUICtrlSetData($label_task, "[ Calibration in progress ]") Else HotKeySet("{F4}") HotKeySet("{F5}") HotKeySet("{F6}") HotKeySet("{F7}") HotKeySet("{F8}") HotKeySet("{F9}") HotKeySet("{F10}") HotKeySet("{F11}") $hotkeys = 0 $info_hotkeys = "INACTIVE" GUICtrlSetData($label_hotkeys, "Status: "&" "&$info_hotkeys) GUICtrlSetData($label_task, "[ End of calibration ]") EndIf EndFunc Func check_mana() ;sleep(700) ;IsSafty() $current_color = PixelGetColor($mana_100_x,$mana_100_y) ;Taking current color from defined mana break point on maan bar $BattleListColor = PixelGetColor($battle_pixel_x, $battle_pixel_y) ;Taking current color from defined posiotion on battle list If _IsChecked_pk_mode($box_pk_mode) Then ;only if pk_mode checkbox is checked If $BattleListColor = $battle_color Then ;If collor on battle list point didnt change, means nothing (player/monster) enter on out screen $RunOrNot = True Else $RunOrNot = False EndIf EndIf If Not ($RunOrNot = False) Then ;If variable RunOrNot are not false it mean is true = is safe If $mana_color = $current_color Then ;If mana color flood mana bar break point floor_maker() ;rune making function Else ;GUICtrlSetData($label_task, "[ Waiting for mana.. ]") Sleep(1000) check_mana() ;Mana arnt ready so back to mana checking EndIf Else ;If not safty then run escape function runforestrun() EndIf EndFunc Func runforestrun() $way_one = GUICtrlRead($Input_22) $way_two = GUICtrlRead($Input_23) ControlSend("Medivia","","", "{" & $way_one & "}" ) Sleep(5000) Do ;GUICtrlSetData($label_task, "[ Not safty outside!! ]") Beep(700,300) Beep(200,500) Sleep(5000) ;IsSafty() $BattleListColor = PixelGetColor($battle_pixel_x, $battle_pixel_y) If $BattleListColor = $battle_color Then $RunOrNot = True Else $RunOrNot = False EndIf Until $RunOrNot = True MouseClick($MOUSE_CLICK_RIGHT, $food_pos_x, $food_pos_y, 4) Sleep(1000) ControlSend("Medivia","","", "{" & $way_two & "}" ) Sleep(2000) check_mana() EndFunc Func mana_100() $pos = MouseGetPos() $mana_100_x = $pos[0] $mana_100_y = $pos[1] $info_100 = "X: "&$mana_100_x&" "&"Y: "&$mana_100_y GUICtrlSetData($label_100, "[F4] Mana point "&" "&$info_100) EndFunc Func mana_get_color() $pos = MouseGetPos() $mana_pixel_x = $pos[0] $mana_pixel_y = $pos[1] $mana_color = PixelGetColor($mana_pixel_x, $mana_pixel_y) $info_mana = "X: "&$mana_pixel_x&" "&"Y: "&$mana_pixel_y GUICtrlSetData($label_mana, "[F5] Mana Bar "&" "&$info_mana) EndFunc Func battle_get_color() $pos = MouseGetPos() $battle_pixel_x = $pos[0] $battle_pixel_y = $pos[1] $battle_color = PixelGetColor($battle_pixel_x, $battle_pixel_y) $info_battlelist = "X: "&$battle_pixel_x&" "&"Y: "&$battle_pixel_y GUICtrlSetData($label_battlelist, "[F7] Battle List "&" "&$info_battlelist) EndFunc Func mouse_pos_food() $pos = MouseGetPos() $food_pos_x = $pos[0] $food_pos_y = $pos[1] $info_food = "X: "&$food_pos_x&" "&"Y: "&$food_pos_y GUICtrlSetData($label_food, "[F8] Food "&" "&$info_food) EndFunc Func mouse_pos_hand() $pos = MouseGetPos() $hand_pos_x = $pos[0] $hand_pos_y = $pos[1] $info_hand = "X: "&$hand_pos_x&" "&"Y: "&$hand_pos_y GUICtrlSetData($label_hand, "[F11] Hand "&" "&$info_hand) EndFunc Func mouse_pos_drop() $pos = MouseGetPos() $drop_pos_x = $pos[0] $drop_pos_y = $pos[1] $info_drop = "X: "&$drop_pos_x&" "&"Y: "&$drop_pos_y GUICtrlSetData($label_drop, "[F10] Drop "&" "&$info_drop) EndFunc Func mouse_pos_blank() $pos = MouseGetPos() $blank_pos_x = $pos[0] $blank_pos_y = $pos[1] $info_blank = "X: "&$blank_pos_x&" "&"Y: "&$blank_pos_y GUICtrlSetData($label_blank, "[F9] Blank "&" "&$info_blank) EndFunc Func afk() ControlSend("Medivia","","","{ctrldown}{down}{ctrlup}") Sleep(350) ControlSend("Medivia","","","{ctrldown}{up}{ctrlup}") EndFunc  
    • jonson1986
      By jonson1986
      Hello I'm trying to translate few text using below code, I found it working previously couple of months ago but Now these days it's not working at all and I'm getting below errors when I run the script and Array display at the end of text also not able to show any translated text instead of value 0 & 1;
      --> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (gt-res-data)
      --> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
      Here is code,
      #include <IE.au3> #include <Array.au3> Local $tag="* # * # *" Local $oIE=_IECreate("https://translate.google.com/#auto/es") Local $oForm=_IEFormGetCollection($oIE,0) Local $oQuery=_IEGetObjByName($oForm,"text") _IEFormElementSetValue($oQuery, $tag & @CR & "Hello World" & @CR & "This is a test" & @CR & $tag) _IEFormSubmit($oForm) _IELoadWait($oIE) Local $oText=_IEGetObjById($oIE,"gt-res-data") $lines=StringSplit(_IEPropertyGet($oText,"innerText"),@CRLF,1) _IEQuit($oIE) _ArrayDelete($lines,_ArraySearch($lines,$tag,1,0,0,1,0) & "-" & $lines[0]) _ArrayDelete($lines,"1-" & _ArraySearch($lines,$tag,1,0,0,1,1)) $lines[0]=UBound($lines)-1 _ArrayDisplay($lines)