CookieCop Posted September 24, 2006 Posted September 24, 2006 Alright, I have this script that works fine: While 1 $coord = PixelSearch( 0, 0, 400, 300, 0xc800ff, 50 ) If Not @error Then MouseClick("Left") EndIf WEnd Problem is, it's a bit slow and it's using up my cpu like crazy. Any idea on how to improve it?
FuryCell Posted September 24, 2006 Posted September 24, 2006 (edited) It is often useful to add a sleep into loops. While 1 Sleep(50) $coord = PixelSearch( 0, 0, 400, 300, 0xc800ff, 50 ) If Not @error Then MouseClick("Left") EndIf WEnd Edited September 24, 2006 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
CookieCop Posted September 24, 2006 Author Posted September 24, 2006 It is often useful to add a sleep into loops. While 1 Sleep(50) $coord = PixelSearch( 0, 0, 400, 300, 0xc800ff, 50 ) If Not @error Then MouseClick("Left") EndIf WEndWewt! Thankyou so much!
CookieCop Posted September 25, 2006 Author Posted September 25, 2006 (edited) Being the rookie I am, I JUST noticed that it delays the response of the script. Anyway to prevent this without lagging the CPU? Like maybe targeting just a small 30 x 30 pixel square aroudn the center of the screen(800 x 600)? EDIT: Nevermind. ;P Edited September 25, 2006 by CookieCop
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now