Sign in to follow this  
Followers 0
BitByteBit

Slow code

2 posts in this topic

My code can speak more than I can I think, it's quite large(600+ lines) so I've uploaded it to codepad.

It ran fine until today, now it uses 100% CPU, interfering with the application it depends on.

Any pointers or hints will be GREATLY appreciated. If you need me to upload it here that is problem.

http://codepad.org/fmnYwHPu

Eagerly awaiting ANY reply.

Share this post


Link to post
Share on other sites



Okay, a couple things:

To load the webpage you do a very clunky {windown}r{winup}

This could be represented as just "#r" though the more direct way would just be:

Shellexecute("http://apps.facebook.com/onthefarm/index.php?ref=ts")

Send("{ALTDOWN}{SPACE}{ALTUP}x")

Ugg!

Winsetstate("FarmVille on Facebook", "",@sw_maximize)

Is there one of your specific functions that chew up CPU time? One thing is check for pixelsearches that are in tight loops, add in a sleep to idle the CPU a bit.

Alternatively, set the Autoit priority lower than Firefox.

You can also use Opt("TrayIconDebug") to get the line number on the tray tool tip, to see what lines of code are causing the problem.

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