Solaron

No Endless Loop Problem

5 posts in this topic

#1 ·  Posted (edited)

Hey guys,

sry for comming here just for this nooby Question.
My Job is coding but I have no idea about Autoit.
I want the code to let a php script run for endless (after 20 minutes it stoped with errors)
But he restarts it just 1-2 times.

 

func _stop()
    Exit
endFunc

HotKeySet("{ESC}","_stop")
Call("Main")

Func Main()
While 1
    $pixel = PixelSearch( 11, 72, 1851, 700, 0x000000)
    If Not @error Then Call("dostuff") 
    sleep(60000);
WEnd
EndFunc

Func dostuff()
MouseClick(("primary"), 382, 12, 1) ;Close php
MouseClick(("primary"), 2661, 493, 1) ;New IP (vpn button)
sleep(30000)
ShellExecute("http://localhost/datencrawler.php")
EndFunc

Would be awesome if you can give me a hint.
Have a nice day!

Edited by Solaron

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Sry was written shortly before I woke up (just like this text).
I want the php script to end with errors.
But can anyone see why my autoit script does for 2-3 loops what I want and then just ingores the if clause ?
Thanks

Edited by Solaron

Share this post


Link to post
Share on other sites
3 minutes ago, Solaron said:

But can anyone see why my autoit script does for 2-3 loops what I want and then just ingores the if clause ?

The Pixel isn't found.

Share this post


Link to post
Share on other sites
4 minutes ago, Solaron said:

I want the php script to end with errors.

? Maybe a shower first?

4 minutes ago, Solaron said:

But can anyone see why my autoit script does for 2-3 loops what I want and then just ingores the if clause ?

What about you do some debugging to see what the result is of PixelSeach() ?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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