Jump to content

Problem with


TxM
 Share

Recommended Posts

EDIT: I didn't finish the title (whoops), the problem is with StatusbarGetText.

OK, I'm trying to write a script to find all the download links in a particular section of this website (only one per page), download them, and continue.

The title of Internet Explorer changes though, each filename is listed in the different titles of the different pages, so I don't know how to get the status of my IE window.

Atleast I think that's the issue with the below code - the result is, it keeps tabbing through all the controls on the page forever.

Do
    $var1 = $var1 + 1; Increase loop count
    Send("{TAB}"); Go to the next control
    Sleep (250); Wait a quarter second
    $var2 = 0
    $var2 = StatusbarGetText("Internet Explorer")
    $var3 = StringInStr($var2, "?path=")
    If $var3 > 0 Then
        Send("{ENTER}"); Click the download link
    EndIf
Until $var3 > 0

Is there some trick to getting around this? For the record, the title of each page would be "FPSBANANA > CSS - Counter-Strike: Source > Maps > " followed by a section name, a map name, and the word Download. (IDK if this will help)

Edited by TxM
Link to comment
Share on other sites

Using IE would make this process alot easier.

look into _IECreate(), and _IELinkGetCollection()

Load then links into an array, then later when downloading use: InetGet() while you loop through the links.

And btw, it is possible to edit the topic title after the topic is created, when switching into "Full Edit".

Edited by jokke
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Thanks, I didn't even realize such functions were available... I've browsed the functions lists several times but I must have had something else on my mind at the time :)

I can probably make it work with this then, however I'm using Vista on IE7 and have 16 tabs going while this process takes place... hopefully that won't interfere.

Thanks for the help, I'll post again if I can't make anything happen with that method.

And btw, it is possible to edit the topic title after the topic is created, when switching into "Full Edit".

EDIT: About Full Edit - I tried that, there doesn't appear to be an editbox for the title, unless I'm really, really dense ^_^

Edited by TxM
Link to comment
Share on other sites

Well, when you use _IECreate() you could either hook into and existing "handle" inn this case tab, then get info from it or create a new one (preffered and default byt using _IECreate()).

About the forum, you'll get the hang of it soon enough.

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Is there any official documentation on these functions? I've google'd each of them and only came to code snippets that I didn't understand, and other links in these forums with problems I could not equate to my own.

I hate to seem like an idiot but my backup plan is always "RTFM," in this case I can't seem to do that :)

EDIT: Since I couldn't figure out how to use the probably more-efficient commands suggested to me, I found a solution in WinGetTitle.

Here's my updated code:

Do
            $var1 = $var1 + 1; Increase loop count
            Send("{TAB}"); Go to the next control
            Sleep (250); Wait a quarter second
            $var2 = 0
            $var3 = WinGetTitle("")
            $var2 = StatusbarGetText($var3)
            $var4 = StringInStr($var2, "?path=")
            If $var4 > 0 Then
                        Send("{ENTER}"); Click the download link
            EndIf
        Until $var4 > 0

I'm still trying to figure out the other way, but for now this is achieving the desired result.

Edited by TxM
Link to comment
Share on other sites

You there is documentation on all of these functions, push F1 while you inn Scite AutoIt code manager, or open the Help File inn the AutoIt directory.

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

You there is documentation on all of these functions, push F1 while you inn Scite AutoIt code manager, or open the Help File inn the AutoIt directory.

Aha, offline documentation tends to elude me X_X Now I really feel stupid.

But on the upside, for anyone else with a similar problem, I found the root of my issue was the dynamic IE title... and I believe using Opt("WinTitleMatchMode", 2) at the beginning of your script, that when searching a window's title, you only have to match a sub-string (part of it, not in any particular place, so it could find "ickD" in "StickDeath")

Correct me if I'm wrong but, this seems like the most logical path for me at this point, because it preserves my code that's already written and I don't have to rework everything.

In any event I'll check the offline documentation next time before posting with something like this.

EDIT: It should be noted that if you have two IE windows open, my plan would probably backfire... It's meant for using only one IE window with tabs.

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