Jump to content

loop "for to" run 8 time and don`t run


Recommended Posts

My code is

#Include <FF.au3>
_FFConnect ()
 
for $i= 98 to 200
        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)
        $text1 = _FFSearch ( "xyz")
        $text2 = _FFSearch ( "go")
        if $text1 =1 Then
             if $text2 = 1 Then
                _FFClick ("Submit2","name")
             EndIf
             
        EndIf
   
Next

my code is go to url My link and , if found 2 text is : "xyz" and "go" then click button "Submit2" but my lood for run 8 time and don`t run. what the matter. i don`t understand. please help me

Link to comment
Share on other sites

Change it a little bit like this:

for $i= 98 to 200
        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)
        $text1 = _FFSearch ( "xyz")
        $text2 = _FFSearch ( "go")

        if $text1 =1 AND $text2 = 1 Then
           _FFClick ("Submit2","name")
        EndIf

Next

And could you please explain better this part : "but my lood for run 8 time and don`t run"

Link to comment
Share on other sites

Change it a little bit like this:

for $i= 98 to 200
        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)
        $text1 = _FFSearch ( "xyz")
        $text2 = _FFSearch ( "go")

        if $text1 =1 AND $text2 = 1 Then
           _FFClick ("Submit2","name")
        EndIf

Next

And could you please explain better this part : "but my lood for run 8 time and don`t run"

I think he means that his code runs 8 loops, then quits.

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Change it a little bit like this:

for $i= 98 to 200
        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)
        $text1 = _FFSearch ( "xyz")
        $text2 = _FFSearch ( "go")

        if $text1 =1 AND $text2 = 1 Then
           _FFClick ("Submit2","name")
        EndIf

Next

code run but same my code, 8 times very good. but time 9 and 10 very slowly. 8 times first very fast 1 minute and time 9 is 1 minute, time 10 is 1 minute. what the matter with my code

Edited by khang0001
Link to comment
Share on other sites

Just an idea, perhaps the webpage you are trying to submit has a built in delay to avoid spamming?

perhaps it allows 8 fast submits and then has a 1 minute delay built in?

code run but same my code, 8 times very good. but time 9 and 10 very slowly. 8 times first very fast 1 minute and time 9 is 1 minute, time 10 is 1 minute. what the matter with my code

Edited by Grefven
Link to comment
Share on other sites

Just an idea, perhaps the webpage you are trying to submit has a built in delay to avoid spamming?

perhaps it allows 8 fast submits and then has a 1 minute delay built in?

I don`t think so, because i submits by my hand and i can submits 20 papers very fast. think my code is not good
Link to comment
Share on other sites

code run but same my code, 8 times very good. but time 9 and 10 very slowly. 8 times first very fast 1 minute and time 9 is 1 minute, time 10 is 1 minute. what the matter with my code

are you sure every page there loading with "fast delay"?

if yes then something wrong with your script....

if no then nothing wrong with your script....

cheer

Link to comment
Share on other sites

are you sure every page there loading with "fast delay"?

if yes then something wrong with your script....

if no then nothing wrong with your script....

cheer

I sure every page load very fast, page 1 to page 8

but page 9 very slow

what happen my code. Is my code wrong

Link to comment
Share on other sites

My code is

#Include <FF.au3>
_FFConnect ()
 
for $i= 98 to 200
        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)
        $text1 = _FFSearch ( "xyz")
        $text2 = _FFSearch ( "go")
        if $text1 =1 Then
             if $text2 = 1 Then
                _FFClick ("Submit2","name")
             EndIf
             
        EndIf
   
Next

my code is go to url My link and , if found 2 text is : "xyz" and "go" then click button "Submit2" but my lood for run 8 time and don`t run. what the matter. i don`t understand. please help me

As far as I can tell there is nothing to slow it down. It exicutes 102 times as fast as it can then quits... try something like:

#Include <FF.au3>
_FFConnect ()
 
for $i= 98 to 200
        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)
        $text1 = _FFSearch ( "xyz")
        $text2 = _FFSearch ( "go")
        if $text1 =1 Then
             if $text2 = 1 Then
                _FFClick ("Submit2","name")
             EndIf
           
        EndIf
        Do
       Sleep(100)
    Until WinGetText ( "http://www.abc.com/join.php?g_id=" & $i, "xyz") = 0
Next

Or even more simply (But less reliable) add some "Sleep(3000)" (Stops program for 3 seconds for screen loadings or what not.)

Hope this helps...

P.S. Sorry about poor formatting of the Do loop, I can't seem to get it right in this editor.

Edited by dakishman

I love AutoIT! It doesn't talk back, it doesn't complain that ur on the computer, it loves to be ran over and over and over... but IT STILL DOESN'T DO THE DISHES... Gatta keep da pimp hand strong...

Link to comment
Share on other sites

As far as I can tell there is nothing to slow it down. It exicutes 102 times as fast as it can then quits... try something like:

#Include <FF.au3>
_FFConnect ()
 
for $i= 98 to 200
        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)
        $text1 = _FFSearch ( "xyz")
        $text2 = _FFSearch ( "go")
        if $text1 =1 Then
             if $text2 = 1 Then
                _FFClick ("Submit2","name")
             EndIf
           
        EndIf
        Do
       Sleep(100)
    Until WinGetText ( "http://www.abc.com/join.php?g_id=" & $i, "xyz") = 0
Next

Or even more simply (But less reliable) add some "Sleep(3000)" (Stops program for 3 seconds for screen loadings or what not.)

Hope this helps...

P.S. Sorry about poor formatting of the Do loop, I can't seem to get it right in this editor.

this code not run, I don`t understand what wrong my code

Link to comment
Share on other sites

this code not run, I don`t understand what wrong my code

There is no pause in your code...

Your code runs all at once...

Try:

#Include <FF.au3>
_FFConnect ()
 
for $i= 98 to 200
        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)
        $text1 = _FFSearch ( "xyz")
        $text2 = _FFSearch ( "go")
        if $text1 =1 Then
             if $text2 = 1 Then
                _FFClick ("Submit2","name")
             EndIf
             
        EndIf
   Sleep(5000)
Next

I love AutoIT! It doesn't talk back, it doesn't complain that ur on the computer, it loves to be ran over and over and over... but IT STILL DOESN'T DO THE DISHES... Gatta keep da pimp hand strong...

Link to comment
Share on other sites

There is no pause in your code...Your code runs all at once...Try:

#Include <FF.au3>_FFConnect () for $i= 98 to 200        _FFStart ("http://www.abc.com/join.php?g_id=" & $i ,1,0)        $text1 = _FFSearch ( "xyz")        $text2 = _FFSearch ( "go")        if $text1 =1 Then             if $text2 = 1 Then                _FFClick ("Submit2","name")             EndIf                     EndIf   Sleep(5000)Next

Add the Sleep function after the _FFStart line, to 'pause' the script before the _FFSearch function executes. This may help.

Does this perform any better for you?

#include <FF.au3>_FFConnect()For $i = 98 To 200 _FFStart("http://www.abc.com/join.php?g_id=" & $i, 1, 0)    _FFLoadWait()   $text1 = _FFSearch("xyz")   $text2 = _FFSearch("go")    If $text1 = 1 And $text2 = 1 Then       _FFClick("Submit2", "name")     _FFLoadWait()   EndIfNext

the code not run, it same my code, run 8 times and time 9 very slowly. is my code wrong
Link to comment
Share on other sites

maybe its the start everytime, try it with the _FFtabadd (a la the example)

#include "ff.au3"

   _FFstart ("http://www.google.com/")


for $i= 98 to 200 step +1
        

        $text1 = _FFSearch ( "About")
        $text2 = _FFSearch ( "Google")

        if $text1 =1  AND $text2 =1 Then
           msgbox (0 , "" , "they are there")
       Else
           msgbox (0 , "" , "they are not there")
        EndIf

  _FFTabAdd ("http://www.google.com/")

Next

 _FFquit ()

exit

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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