Math2 Posted December 28, 2011 Share Posted December 28, 2011 (edited) Here is part of the script:While 1 Sleep(15) $coord1 = PixelSearch(300, 641, 345, 685, 13816530, 16,) If IsArray($coord1) = True Then Send("{a}") EndIf If IsArray($coord1) = True Then Send("{a down}") EndIf WEndBut it is missing some "send key". Example, appears 2 and it only send one and miss the other. I think it is because I use vista, but I'm not sure. Is possible to optimize this script or I have to change the OS ? Edited December 28, 2011 by Math2 Link to comment Share on other sites More sharing options...
Bert Posted December 28, 2011 Share Posted December 28, 2011 (edited) I see you send "{a}" then an Send("{a down}"). If you want your loop to run faster shorten your sleep statement. Of course you run the risk of increasing your processor overhead. Changing your OS won't make a difference seeing how you are viewing a virtual PC screen when doing your search. Edited December 28, 2011 by MPH The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Math2 Posted December 28, 2011 Author Share Posted December 28, 2011 (edited) Did you suggest to me reduce the Sleep ? If yes, I had already tried reduce the sleep, it gets a little bit better, but continue missing. And before this numbers of the PixelSearch I tried more numbers and this was the best, but continue missing points, I think that is my processor, What do you think ? Edited December 28, 2011 by Math2 Link to comment Share on other sites More sharing options...
willichan Posted December 28, 2011 Share Posted December 28, 2011 If IsArray($coord1) = True Then Send("{a}") EndIf If IsArray($coord1) = True Then Send("{a down}") EndIf It might run a bit more efficiently if you weren't checking to see if $coord1 were an array twice. You should be able to just do it once. Conditional statements tend to use more CPU. If IsArray($coord1) = True Then Send("{a}") Send("{a down}") EndIf You might also condense it down to just one Send() statement. If IsArray($coord1) = True Then Send("{a}{a down}") My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
Blue_Drache Posted December 29, 2011 Share Posted December 29, 2011 so ... my question is ... why are you pressing A ... and then holding it down? Do you have an {a up} later on in the script to cancel the hold-down? Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 29, 2011 Share Posted December 29, 2011 Since you said you were on Vista, do a search for DWM. You will find explanations both on why PixelSearch() can be very slow and how to fix it. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Math2 Posted December 29, 2011 Author Share Posted December 29, 2011 (edited) I solved the problem changing the color. But Thank you all. And willichan works too, now to write is more easy, thank you. Edited December 29, 2011 by Math2 Link to comment Share on other sites More sharing options...
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