Jump to content

IE.au3


Recommended Posts

Ok so I posted a topic earlier, and come to find out, it's a lot harder to do then it was posted in the topic. The only thing that remains constant in the source of the page is this:

<input type=button value="Back" onclick="document.location='i.cfm?&vhir&f=sc_research';" class=pic> <input type=button value="Start Research !"

the rest of it is like this:

name=y12kh1p onclick="x1bqyni(y12kh1p);

the y in the above is constant, the x in the above is constant, everything after the y and the x changes every single page reload.

As you can tell from what is listed, it's a button, and the button moves around. It moves up, down, has a anti-bot feature that comes up and makes it move down farther, then when a level is complete, it moves up farther. If there is a way to do a pixel search for the box size, or a easy-ish way to make it so it can find the button and click it. I would be super greatful.

I am not very good at coding in autoit yet. I have wrote simple scripts that consists of mouse clicking coordinates and whatnot. Stuff that takes no real talent to write. However this is very complicated and I am stumped. Any help would be greatly appreciated.

Link to comment
Share on other sites

Heres a solution .... BUT only works in top document of a IE window, not tabs.

#include <IE.au3>
    _IEErrorHandlerRegister ("MyErrFunc1")
    $oIE = _IEAttach ("[SFU] Unification Wars", "Title")
    $oDoc = _IEDocGetObj ($oIE)
    $forms = _IEFormGetCollection ($oDoc)
        For $form in $forms
            $frmobjs = _IEFormElementGetCollection ($form)
                For $frmobj in $frmobjs
                    $value = $frmobj.value
                    if $value = "Start Research !" Then
                        $butname = $frmobj.name 
                        $oButton = _IEFormElementGetObjByName($form,$butname)
                        _IEAction($oButton, "click")            
                        endif
                    
                    next

next
func MyErrFunc1()
 ConsoleWrite($frmobj.value)
 EndFunc

Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

Link to comment
Share on other sites

Ok, so I took this script and I made a few adjustments to where it loops, and where it does what I want it to do. But I get this error when it loops....

Line 43 (script file path here)

$value = $fromobj.value

$value = $fromobj.value^ ERROR

Error: The requested action with this object has failed.

What does this error mean? How would I fix it? Would it be easier just to leave the script where it doesn't loop, and make a script that just sends the key to make the script work?

Link to comment
Share on other sites

Topic closed.... sorted out thru Private messages

Edited by Hasher

Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

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...