Jump to content

Do Next in a "For Next Loop"


 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Developers

Define integrate Timer.

Sleep() -> pause a defined period

TimerInit() & TimerDiff() -> Test for a particular period.

Jos

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

Link to comment
Share on other sites

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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]

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