Jump to content
Sign in to follow this  
foray

Do Next in a "For Next Loop"

Recommended Posts

foray

hey there, i got a small problem. sometimes my function call "protector($protectthreadlink[0], $hostername[0])" needs to much time or hang up at all, cause of the website isn´t reachable or something like that. is there any way to skip the current function call and go to the next $i?! best case would be a timer for about 10 seconds. if function dosnt get ready at this 10 seconds, skip to the next entry... hotkey would be also possible! maybe someone can help! Thanks!

While 1
    Sleep(10)
WEnd

Func decrypt()
    $SourceCode = _FFReadHTML()
    
    select
        Case StringInStr ($SourceCode,"protector.to") = True
            $protectthread = _StringBetween($SourceCode, '<div class="fileinfo">','<td class="name">')

            For $i = 0 To UBound($protectthread) -1
                $hostername = _StringBetween($protectthread[$i], 'Hoster: ','<br')
                $protectthreadlink = _StringBetween($protectthread[$i], 'a href="','"')
                protector($protectthreadlink[0], $hostername[0])
            Next

    EndSelect
EndFunc

Share this post


Link to post
Share on other sites
foray

hmm thanks at all, but how to integrate a timer?! any ideas/hints? thanks!

Share this post


Link to post
Share on other sites
foray

thanks again, but the basic stuff i already know, but i have no clue howto integrate it ^_^

can u gimme a little example, would be great!

Share this post


Link to post
Share on other sites
Jos

Don't understand the question: The helpfile gives coding examples of all Functions, so you will have to show us what you want to do before I can comment.


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
WideBoyDixon

I assume we're ignoring the obvious error here:

Case StringInStr ($SourceCode,"protector.to") = True

In addition, you need to change your function called protector() so that it can time out. You can't force a "Next" while your script is executing that function.

WBD

Share this post


Link to post
Share on other sites
Skruge

I assume we're ignoring the obvious error here:

Case StringInStr ($SourceCode,"protector.to") = True
StringInStr returns 0 if the substring isn't found, and a non-zero if it is.

Numbers can be compared to True/False, so there's no error here.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

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
Sign in to follow this  

×