Sign in to follow this  
Followers 0
khang0001

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

17 posts in this topic

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

Share this post


Link to post
Share on other sites



loop for 8 times

For $i=1 To 8
    ConsoleWrite("Loop " & $i & @CRLF)
Next

but im not sure for your script inside for

Share this post


Link to post
Share on other sites

loop for 8 times

For $i=1 To 8
    ConsoleWrite("Loop " & $i & @CRLF)
Next

but im not sure for your script inside for

I don`t understand your code, please write this code in my code.

Share this post


Link to post
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"

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

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


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

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()
    EndIf
Next

Share this post


Link to post
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

Share this post


Link to post
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

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

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  
Followers 0