Jump to content

_IELinkGetCollection help, pls


 Share

Recommended Posts

Hi, again me :P

I can't get to work my script, to open all the link that _IELinkGetCollection "collected". Any idea? Any feature to filter those links it opens?

Thank you for your help!

Mark

Show what you tried.

A very common mistake (easily found if you searched first) is to attempt to continue using objects in the collection after having navigated IE away from the page it came from, which invalidates all the objects in the collection. Any chance you are repeating that well worn faux pas?

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Hello!

Here is the script:

#include <IE.au3>
$oIE = _IECreate ("http://swle.yarold.eu/main.php")
Sleep (5000)
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("nickname")
Send ("{TAB}")
Send ("password")
Send ("{TAB}")
Send ("{TAB}")
Send ("{ENTER}")
Sleep (5000)
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")
For $oLink In $oLinks
    _IECreate ($oLink.href)
    Sleep (1)
Next

Now, it working! (So nice login method :P)

2 things remarning. How could i filter wich link to open? Some easyer way to login? Thanks for help!

Mark

Link to comment
Share on other sites

Just would like to show where i am :P

#include <IE.au3>
$i = -1
$usernm = ":P"
$passwd = ":P"
$oIE = _IECreate ("http://swle.yarold.eu/main.php")
$HATT = "A human awareness test"
WinWait("Yarold's Samurai War Link Exchange - Windows Internet Explorer")
Sleep (500)
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
;$usernm = InputBox("Username", "Enter your username.")
Sleep (150)
Send ($usernm)
Send ("{TAB}")
;$passwd = InputBox("Password", "Enter your password.", "", "*")
Sleep (150)
Send ($passwd)
Send ("{TAB}")
Send ("{TAB}")
Send ("{ENTER}")
Sleep (7000)
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
$iNumLinks2 = $iNumLinks - 23
MsgBox(0, "Link Info", $iNumLinks2 & " links found")
For $oLink In $oLinks
    $i = $i + 1
    If $i > 22 OR $iNumLinks - 1 > $i Then
        _IELinkClickByIndex ($oLink.href, $i, 0)
        If _IEPropertyGet ($oLink, "tilte")= $HATT Then
            MsgBox (0, "HAT!", "I found a Human Awarness Test! Watch out!")
        Endif
    EndIf   
    Sleep (1)
Next

I have an idea for filtering, i will use IELinkClickbyIndex with an if method. Too lazy to calculate now :P

The only thing that i cant get work, the

If _IEPropertyGet ($oLink, "tilte")= $HATT Then
    MsgBox (0, "HAT!", "I found a Human Awarness Test! Watch out!")
Endif

Could anybody help to fix it?

Update: with IELink.... , but not workig :o Pls check out, whats the problem

Edited by bmarky
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...